xml文件为什么不用DOM呢?- Set fso = CreateObject("Scripting.FileSystemObject")
- Set xmlDom = CreateObject("Microsoft.XMLDOM")
- xmlDom.async = "false"
- xmlDom.load "a.xml"
- set nodes = xmlDom.getElementsByTagName("classification")
- for each node in nodes
- s = s & space(10) & node.getAttribute("name") & vbCrLf
- for each child in node.childNodes
- if (child.nodeName="material") then
- s = s & child.getAttribute("name") & vbCrLf
- end if
- next
- next
- fso.OpenTextFile("classification.txt",2,true).Write s
复制代码
|