Dim SQL,RSSet RS = Server.CreateObject("ADODB.RecordSet")SQL = "SELECT showname FROM download"
RS.Open  SQL,Connys,1,1
RS.MoveFirstDim xmldoc
Set xmldoc = server.CreateObject("Msxml2.DOMDocument.4.0")Dim version
Set version = xmldoc.createProcessingInstruction("xml","version='1.0' encoding='GB2312'")
xmldoc.appendchild(version)Dim root
Set root = xmldoc.CreateNode(1, "root","")
xmldoc.appendChild(root)do while (Not RS.EOF)
Set childNode = xmldoc.CreateNode(1,"student","")
For Each f in rs.Fields
Set childnextNode = xmldoc.CreateNode(1,f.name,"")
childnextNode.Text = f.Value
childNode.appendChild(childnextNode)
Next
RS.MoveNext
root.appendChild childNode
loopxmldoc.save(Server.Mappath("info.xml"))%>asp写的,你到download.mircosoft.com有MSXML 4.0下,里面有详细的SDK。
有js的例子。

解决方案 »

  1.   

    老大,在是java专区。
    asp我没有用。现在有个xml文件<?xml version="1.0" encoding="gb2312"?>
    <root>
        <Name savepath="D:\新建文件夹\新建文件夹" savesystem="Uinx">yang</Name>
    </root>我怎么把这个节点
    <Name savepath="C:\dfh\" savesystem="Window">TT</name>
    添加进去DocumentBuilder parser; DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); try { parser = factory.newDocumentBuilder(); Document doc = parser.parse("user.xml"); Element newlink=doc.createElement(name); doc.getDocumentElement().appendChild(newlink); ((XmlDocument)doc).write(new FileOutputStream(new File("user.xml"))); } catch (Exception e) { //to log it } 这样不好加