ASP动态生成XML 首页图片轮显

 
<!--#include file="conn.asp"-->


<%
strC = "<?xml version=""1.0"" encoding=""utf-8""?> " & vbcrlf
strC = strC&" <root>" & vbcrlf    

set rs = server.CreateObject("adodb.recordset")
set rs1 = server.CreateObject("adodb.recordset")
sql = "select anclassid,anclass from bsort order by anclassidorder"    
rs.open sql,conn,1,1
do while not rs.eof
    strC = strC&"<bigsort anclassid='"&rs(0)&"' name='"&rs(1)&"' >"& vbcrlf
    sql1 = "select nclassid,nclass from ssort where anclassid = "&rs(0)&" order by nclassidorder"
    rs1.open sql1,conn,1,1
    do while not rs1.eof
    strC = strC&"<ssort id='"&rs1(0)&"' name='"&rs1(1)&"'>"&rs1(1)&" </ssort>"& vbcrlf
    rs1.movenext
    loop
    rs1.close
    strC = strC&"</bigsort>"& vbcrlf
rs.movenext
loop
rs.close
strC = strC&" </root>" & vbcrlf    


call saveXml(strC,"111111.xml")

Function saveXml(Text,FileName)    
dim xmldoc,path
set xmldoc= server.CreateObject("MSXML.DOMDocument")
path = Server.MapPath(FileName)
xmldoc.LoadXML(Text)
xmldoc.save(path)
set xmldoc= nothing
End Function


%>
转载地址:http://shijie.blog.51cto.com/116032/116646
阅读更多
个人分类: ASP
想对作者说点什么? 我来说一句

asp动态生成xml

quweiie quweiie

2012-11-13 21:03:03

阅读数:3651

没有更多推荐了,返回首页

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭