|
- '遍历XML文件示范
- Dim objXMLDoc
- Dim xmlProduct
- Dim productCode
- Dim productName
- Set objXMLDoc = Server.CreateObject("Msxml2.DOMDocument.6.0")
- objXMLDoc.async = False
- objXMLDoc.load Server.MapPath("xml/9-2022081214480742535.xml")
-
- For Each xmlProduct In objXMLDoc.documentElement.selectNodes("//Records/Record")
- productCode = xmlProduct.selectSingleNode("序号").text
- productName = xmlProduct.selectSingleNode("用途").text
- Response.Write Server.HTMLEncode(productCode) & "-------------"
- Response.Write Server.HTMLEncode(productName) & "<br>"
- Next
- Set objXMLDoc =Nothing
- '单个节点读取
- response.Write objXMLDoc.selectSingleNode("//Records//RecordTY/中文").text
复制代码
|
|