I don't know a lot about XML, so hang in there please.
Scenario:
A XML file is written in a webservice and returns it to an asp page for parsing.
Returned in the xml.responsetext:
<?xml version="1.0" encoding="utf-8" standalone="no"?> <PartAvailabilityResponse> <OnHand>96</OnHand> <BinLocation>NO BIN</BinLocation> </PartAvailabilityResponse>
Asp Parsing Attempt:
I have tried a number of ways... ways that have been successful before. The only partial success I have had so far is it being seen and read as one element returning "96 NO BIN"
Set objLst = CreateObject("MSXML2.DOMDocument")
objLst.Loadxml (xmlhttp.responseTEXT)
Set node_list = objLst.documentElement.selectNodes("PartAvailabilityResponse") Errors:Object required:
'[object]'
Tried to see if length will work:
Set objLst = CreateObject("MSXML2.DOMDocument")
objLst.Loadxml (xmlhttp.responseTEXT)
response.write "length="&(objLst.length) Errors:Object doesn't support this property or method: 'length'
Tried: Set objLst =Server.CreateObject("Microsoft.xmlDOM") same errors
Partial Success: Returns the result .. '96 NO BIN'
Set objLst = CreateObject("MSXML2.DOMDocument")
objLst.Loadxml (xmlhttp.responseTEXT)
set node_list = objLst.GetElementsByTagName("*")
ss= node_list.item(0).text
response.write(ss) Returns: 96 NO BIN
response.write "length="&(node_list.length) Returns: 1
Appreciate any help.