Do one thing,
dim v_objXML, v_rootnode
Set v_objXML = Server.CreateObject("Msxml2.DOMDocument.4.0")
v_objXML.Async = False
if (v_objXML.Load(Server.MapPath("../configuration/settings.xml"))) then
set v_rootnode = v_objXML.documentElement
ProjectSetting = v_rootnode.selectsinglenode("param[@name='"" & value & ""']").text
end if
This should solve Ur Problem. The error U might be getting is becoz of the XML file not loaded, and U r trying to access the nodes before the file is loaded.
Quote:
quote:Originally posted by Kabe
hi
have this function in asp
Function ProjectSetting(value)
dim v_objXML, v_rootnode
Set v_objXML = Server.CreateObject("Msxml2.DOMDocument.4.0")
v_objXML.Async = False
v_objXML.Load(Server.MapPath("../configuration/settings.xml"))
set v_rootnode = v_objXML.documentElement
ProjectSetting = v_rootnode.selectsinglenode("param[@name='"" & value & ""']").text
End Function
But the function results every time in an error because variable "value" has not yet any data.
Even when I try to use the funcion WITH data, still an error.
How to work around this correctly ?
Thx a lot
|
Thanks and regards,
Raj Babar