我有一些非常簡單的XML:查詢XML沒有XSL
<properties>
<property>
<name>BobFish</name>
<explaination>Bob is a fish.</explaination>
</property>
<property>
<name>DaveFish</name>
<explaination>Dave is a fish.</explaination>
</property>
我想從ASP如果查詢。喜歡的東西:
Response.Write (GetExplaination("BobFish"))
這是我迄今爲止功能:
Function GetExplaination(strXMLFile, strName)
'Declare local variables
Dim objXML
Dim objNode
set objXML = Server.CreateObject("Microsoft.XMLDOM")
objXML.load(strXMLFile)
Set objNode = objXML.SelectSingleNode("properties/property[name='" & strName & "']")
GetExplaination = "Nothing Yet"
End Function
所以我有一個包含我所需要的數據objNode。我如何從中提取「解釋」字段?
非常感謝。 – theaxe 2009-05-05 16:56:35