asp中利用MSXML2.DOMDocument解析xml文件

set xmlDoc = server.CreateObject("MSXML2.DOMDocument")
xmlDoc.loadXML("
深州
26
衡水
25
")
set root = xmlDoc.documentElement
set oNodeList = root.childNodes
for each item in oNodeList
  response.Write item.getattribute("name")
  response.Write vbcrlf
  'response.Write item.xml
  set childs = item.childNodes
  for each subitem in childs
    response.Write subitem.baseName
    response.Write "="
    response.Write subitem.text
    response.Write vbcrlf
  next
next

你可能感兴趣的:(ASP)