The following example shows how to create a XML file with asp.
First, we write a function named “CreateXml”
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | sub CreateXml(FilePath) startime=timer() dim XmlDoc,Root Set XmlDoc = Server.CreateObject("Microsoft.XMLDOM") XmlDoc.async = False Set Root = XmlDoc.createProcessingInstruction("xml","version='1.0' encoding='UTF-8'") XmlDoc.appendChild(Root) XmlDoc.appendChild(XmlDoc.CreateElement("files")) XmlDoc.Save(Server.MapPath(FilePath)) Set Root = Nothing Set XmlDoc = Nothing LoadData(ZipPathDir) endtime=timer() response.Write("<span style=' color:#ff0000;'>time:" & FormatNumber((endtime-startime),3) & "s</span>") End sub |
then,we can use it to create xml file.
1 2 3 | Dim ZipPathFile ZipPathFile = "update.xml" CreateXml(ZipPathFile) |


