what is missing with this code to retrieve value of "model' from xml file ?
===asp file=============
response.write getXMLField("//actions[ [at] 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 ======
<?xml version="1.0" ?>
<actions>
<action value="">
<model>none</model>
<view>login.asp</view>
</action>
<action value="welcome">
<model>checkLogin.asp</model>
<view>welcome.asp</view>
</action>
</actions>
