ASP常用函数:ArrayToxml
人气:0想了解ASP常用函数:ArrayToxml的相关内容吗,在本文为您仔细讲解的相关知识和一些Code实例,欢迎阅读和指正,我们先划重点:ASP常用函数:ArrayToxml,下面大家一起来学习吧。
<% 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
%>
加载全部内容