ASP常用函数:ArrayToxml
更新时间:2007年02月07日 00:00:00 作者:
<%
Public Function ArrayToxml(DataArray, Recordset, row, xmlroot)
Dim i, node, rs, j
If xmlroot = "" Then xmlroot = "xml"
Set ArrayToxml = Server.CreateObject("msxml2.FreeThreadedDOMDocument"& MsxmlVersion)
ArrayToxml.appendChild(ArrayToxml.createElement(xmlroot))
If row = "" Then row = "row"
For i = 0 To UBound(DataArray, 2)
Set Node = ArrayToxml.createNode(1, row, "")
j = 0
For Each rs in Recordset.Fields
node.Attributes.setNamedItem(ArrayToxml.createNode(2, LCase(rs.Name), "")).text = DataArray(j, i)& ""
j = j + 1
Next
ArrayToxml.documentElement.appendChild(Node)
Next
End Function
%>
Public Function ArrayToxml(DataArray, Recordset, row, xmlroot)
Dim i, node, rs, j
If xmlroot = "" Then xmlroot = "xml"
Set ArrayToxml = Server.CreateObject("msxml2.FreeThreadedDOMDocument"& MsxmlVersion)
ArrayToxml.appendChild(ArrayToxml.createElement(xmlroot))
If row = "" Then row = "row"
For i = 0 To UBound(DataArray, 2)
Set Node = ArrayToxml.createNode(1, row, "")
j = 0
For Each rs in Recordset.Fields
node.Attributes.setNamedItem(ArrayToxml.createNode(2, LCase(rs.Name), "")).text = DataArray(j, i)& ""
j = j + 1
Next
ArrayToxml.documentElement.appendChild(Node)
Next
End Function
%>
相关文章
ASP编程入门进阶(十四):Browser & Linking
ASP编程入门进阶(十四):Browser & Linking...2007-01-01chr(9)、chr(10)、chr(13)、chr(32)、chr(34)讲解
chr(9)、chr(10)、chr(13)、chr(32)、chr(34)讲解...2007-03-03javascript asp教程第六课-- response方法
javascript asp教程第六课-- response方法...2007-03-03对象标记具有无效的 ''MSWC.MyInfo'' ProgID
对象标记具有无效的 ''MSWC.MyInfo'' ProgID...2007-02-02
最新评论