如何用Asp动态生成xml文件
Function ReplaceChar ( FstrSource )
dim strRet
if IsNull(FstrSource) then
FstrSource = ""
end if
strRet = Replace ( FstrSource , "&" , "&" )
strRet = Replace ( strRet , "<" , "<" )
strRet = Replace ( strRet , ">" , ">" )
strRet = Replace ( strRet , """" , """ )
strRet = Replace ( strRet , "'" , "'" )
ReplaceChar = strRet
End Function
function RstToxml(标准化越来越近了) (FrstRst, FstrRstName)
dim strSpace 'space string behand of element
dim intLevel 'level of the element
dim strxml(标准化越来越近了) 'the return string(xml(标准化越来越近了) string)
dim intRstField
dim strShortDate
'document level
intLevel = 0
strSpace = space (intLevel * 2)
if Len(FstrRstName)>0 then
strxml(标准化越来越近了)=strSpace & "<" & FstrRstName & ">" & vbCR
intLevel = intLevel + 1
strSpace = space(intLevel*2)
end if
if FrstRst.EOF then
strxml(标准化越来越近了) = strxml(标准化越来越近了)&strSpace & "<Record"
for nCount=0 to FrstRst.Fields.Count-1
strxml(标准化越来越近了) = strxml(标准化越来越近了) & space(1)&FrstRst.Fields(nCount).Name&"=''"
next
strxml(标准化越来越近了) = strxml(标准化越来越近了) & "/>" &vbCR
if Len(FstrRstName)>0 then
strxml(标准化越来越近了)=strxml(标准化越来越近了)&strSpace & "</" & FstrRstName & ">" & vbCR
end if
RstToxml(标准化越来越近了)=strxml(标准化越来越近了)
exit function
end if
' now move in""" & ReplaceChar(objField.Value) & """"
end if
next
strxml(标准化越来越近了) = strxml(标准化越来越近了) & "<Record "&strTemp& "/>" & vbCR
FrstRst.MoveNext
loop
intLevel=intLevel-1
strSpace=space(intLevel * 2)
if Len(FstrRstName)>0 then
strxml(标准化越来越近了) = strxml(标准化越来越近了) & strSpace & "</" & FstrRstName & ">" & vbCR
end if
RstToxml(标准化越来越近了) = strxml(标准化越来越近了)
- 最新文章
- 用EasyMailObject组件处理Exchange邮件源..[04-14]
- 用EasyMailObject组件处理Exchange邮件源..[04-14]
- 用EasyMailObject组件处理Exchange邮件源..[04-14]
- 用EasyMailObject组件处理Exchange邮件源..[04-14]
- 用EasyMailObject组件处理Exchange邮件源..[04-14]
- 用EasyMailObject组件处理Exchange邮件源..[04-14]
- 相关文章
- asp实现k线图(在线)[04-14]
- 利用ASP+XML架设在线考试系统[04-14]
- ASP项目中的通用条件查询模块[04-14]
- ASP程序界面的多语言支持[04-14]
- 中文的无组件文件上传ASP函数[04-14]
- 一个利用adsi得到局域网信息的asp文件[04-14]
