asp.net - VBScript getAttribute is not a member of MSXML.IXMLDOMNode -
converting classic .asp application .aspx , function below takes in xml snippet. works fine in asp gives me comipilation error "error bc30456: getattribute not member of msxml.ixmldomnode" in .aspx
function extractdatafromxml(byref sinputxml string) string dim xmldom msxml.domdocument dim currnode msxml.ixmldomnodelist dim node msxml.ixmldomnode dim serror string dim sresult string xmldom = new msxml.domdocument xmldom.async = false if (xmldom.loadxml(sinputxml) = false) sresult = "xml parse error: " & xmldom.parseerror.reason & " code=" & xmldom.parseerror.errorcode & " " & chr(13) & chr(10) else currnode = xmldom.selectnodes("//push-response") each node in currnode serror = node.selectsinglenode("response-result").getattribute("code") if serror = "1000" sresult = node.selectsinglenode("address").text else sresult = "error " & serror & ": " & node.selectsinglenode("response-result").getattribute("desc") end if next node end if extractdatafromxml = sresult end function
i must using wrong type of xml document interface i'm not sure interface should use.
can give me clue on need code work in .aspx/vbscript environment, please..?
attributes property of ixmldomnode of type ixmldomnamednodemap
so use node.selectsinglenode("response-result").attributes.getnameditem("code")
Comments
Post a Comment