ASP常用函数:ArrayToxml_ASP教程-查字典教程网
ASP常用函数:ArrayToxml
ASP常用函数:ArrayToxml
发布时间:2016-12-29 来源:查字典编辑
摘要:

<%

PublicFunctionArrayToxml(DataArray,Recordset,row,xmlroot)

Dimi,node,rs,j

Ifxmlroot=""Thenxmlroot="xml"

SetArrayToxml=Server.CreateObject("msxml2.FreeThreadedDOMDocument"&MsxmlVersion)

ArrayToxml.appendChild(ArrayToxml.createElement(xmlroot))

Ifrow=""Thenrow="row"

Fori=0ToUBound(DataArray,2)

SetNode=ArrayToxml.createNode(1,row,"")

j=0

ForEachrsinRecordset.Fields

node.Attributes.setNamedItem(ArrayToxml.createNode(2,LCase(rs.Name),"")).text=DataArray(j,i)&""

j=j+1

Next

ArrayToxml.documentElement.appendChild(Node)

Next

EndFunction

%>

相关阅读
推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
  • 大家都在看
  • 小编推荐
  • 猜你喜欢
  • 最新ASP教程学习
    热门ASP教程学习
    编程开发子分类