retrive xml value from localfile
am 19.08.2007 20:49:52 von Jon Paalwhat is missing with this code to retrieve value of "model' from xml file ?
===asp file=============
response.write getXMLField("//actions[@action='welcome']/model")
Function getXMLField(strFieldName)
On error resume next
Dim objDom
Dim objField
'XML file object
Set objDom = Server.CreateObject("Msxml2.DOMDocument.3.0")
objDom.async = False
if objDom.Load (Server.MapPath(".") & "\Actions.xml") then
'collect information from nodes
'-------------------------------
objField = objDom.selectSingleNode(strFieldName)
If objField Is Nothing Then
getXMLField = strFieldName & " is nothing"
Else
getXMLField= objField.Text
End If
Else
getXMLField= objDom.parseError.reason
End If
'Release variables
Set objDom = Nothing
End Function
======= xml file ======