日期:2014-05-16 浏览次数:21134 次
<?xml version="1.0" encoding="UTF-8" ?>
- <TrackResult>
<message>完成</message>
<nu>123456</nu>
- <data>
- <itme>
<time>2013-06-28</time>
<context>提交</context>
</itme>
- <itme>
<time>2013-06-29</time>
<context>处理中</context>
</itme>
- <itme>
<time>2013-06-30</time>
<context>完成</context>
</itme>
</data>
<state>1</state>
<condition>7</condition>
</TrackResult>
<%
s = "<?xml version=""1.0"" encoding=""UTF-8"" ?><TrackResult><message>完成</message><nu>123456</nu><data><itme><time>2013-06-28</time><context>提交</context></itme><itme><time>2013-06-29</time><context>处理中</context></itme><itme><time>2013-06-30</time><context>完成</context></itme></data><state>1</state><condition>7</condition></TrackResult>"
Set oDoc = CreateObject("Msxml2.DOMDocument")
With oDoc
.async = False
.validateOnParse = False
.preserveWhiteSpace = False
.resolveExternals = False
.loadXML s
If .parseError.errorCode <> 0 Then
sErrMsg = .parseError.errorCode & "
------解决方案--------------------
" & .parseError.srcText & "
------解决方案--------------------
" & .parseError.reason
Response.Write sErrMsg
End If
End With
Set oNode = oDoc.selectSingleNode("//message")
If Not oNode Is Nothing Then
Response.Write "message:" & oNode.text
End If
Set oNode = oDoc.selectSingleNode("//nu")
If Not oNode Is Nothing Then
Response.Write "nu:" & oNode.text
End If
Set oNodes = oDoc.selectNodes