Note that there are some explanatory texts on larger screens.

plurals
  1. POIssue with XML / SelectNodes using ASP VBScript
    primarykey
    data
    text
    <p>Got an issue displaying information from XML. I think it has something to do with selecting the correct Node (Company Name). Need a fresh opinion... got a feeling I am probably overlooking something really simple. Code as follows</p> <p>XML</p> <pre><code>&lt;GovTalkMessage&gt; &lt;EnvelopeVersion&gt;1.0&lt;/EnvelopeVersion&gt; &lt;Header&gt; &lt;MessageDetails&gt; &lt;Class&gt;CompanyDetails&lt;/Class&gt; &lt;Qualifier&gt;response&lt;/Qualifier&gt; &lt;TransactionID&gt;9999999999999&lt;/TransactionID&gt; &lt;GatewayTest&gt;TRUE&lt;/GatewayTest&gt; &lt;GatewayTimestamp&gt;2013-09-24T17:51:41-00:00&lt;/GatewayTimestamp&gt; &lt;/MessageDetails&gt; &lt;SenderDetails&gt; &lt;IDAuthentication&gt; &lt;SenderID&gt;******&lt;/SenderID&gt; &lt;Authentication&gt; &lt;Method&gt;CHMD5&lt;/Method&gt; &lt;Value&gt;&lt;/Value&gt; &lt;/Authentication&gt; &lt;/IDAuthentication&gt; &lt;EmailAddress&gt;rte@rrfsolicitors.com&lt;/EmailAddress&gt; &lt;/SenderDetails&gt; &lt;/Header&gt; &lt;GovTalkDetails&gt; &lt;Keys/&gt; &lt;/GovTalkDetails&gt; &lt;Body&gt; &lt;CompanyDetails&gt; &lt;CompanyName&gt;MILLENNIUM STADIUM PLC&lt;/CompanyName&gt; &lt;CompanyNumber&gt;03176906&lt;/CompanyNumber&gt; &lt;RegAddress&gt; &lt;AddressLine&gt;MILLENNIUM STADIUM&lt;/AddressLine&gt; &lt;AddressLine&gt;WESTGATE STREET&lt;/AddressLine&gt; &lt;AddressLine&gt;CARDIFF&lt;/AddressLine&gt; &lt;AddressLine&gt;CF10 1NS&lt;/AddressLine&gt; &lt;/RegAddress&gt; &lt;/CompanyDetails&gt; &lt;/Body&gt; &lt;/GovTalkMessage&gt; </code></pre> <p>ASP Code;</p> <pre><code>Set XMLDom = CreateObject("MSXML2.DomDocument.6.0") XMLDom.async = false XMLDom.LoadXML (theXML) theNode = "/GovTalkMessage/Body/CompanyDetails" Set NodeList = XMLDom.SelectNodes(theNode) nodeCount = XMLDom.SelectNodes(theNode).length if XMLDom.parseerror = 0 then Response.Write(nodeCount) For Each Node in NodeList response.write(Node.text &amp; "&lt;br&gt;") Next else response.Write("Error Parsing Results") end if Set XMLDom = Nothing </code></pre> <p>Results: nodeCount = 0</p> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload