当前位置: 移动技术网 > IT编程>开发语言>.net > 如何用Asp动态生成xml文件

如何用Asp动态生成xml文件

2018年10月12日  | 移动技术网IT编程  | 我要评论

快播人人,兽兽成双txt下载,北京公众出行网

function replacechar ( fstrsource )
  dim strret
  if isnull(fstrsource) then
    fstrsource = ""
  end if
  strret = replace ( fstrsource , "&" , "&" )
  strret = replace ( strret , "<" , "&lt;" )
  strret = replace ( strret , ">" , "&gt;" )
  strret = replace ( strret , """" , "&quot;" )
  strret = replace ( strret , "" , "&apos;" )
  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 one level
  intlevel = intlevel + 1
  strspace = space (intlevel * 2)
 
  loop through the records
  dim strtemp
  frstrst.movefirst
  do while not frstrst.eof
    strtemp = ""
      loop through the fields
      strxml(标准化越来越近了) = strxml(标准化越来越近了) & strspace & "<record"
      for each objfield in frstrst.fields
      set objfield = frstrst.fields(intrstfield)
          strtemp = strtemp & space (1) & objfield.name & "="
             strtemp = strtemp & """" & 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(标准化越来越近了)

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网