Quantcast
Channel: XML, System.Xml, MSXML and XmlLite forum
Viewing all articles
Browse latest Browse all 935

Can't Parse in Asp xml file from xmltextwriter.

$
0
0

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.




Viewing all articles
Browse latest Browse all 935

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>