title: How do I selectSingleNode in xml with vbscript and classic asp?
body: <p>From <a href="http://www.devguru.com/technologies/xmldom/quickref/node_selectsinglenode.html" rel="nofollow">here</a>:
  xml:</p>
  
  <pre><code>&lt;Vocabulary&gt; 
     &lt;Word type="noun" level="1"&gt; 
        &lt;English&gt;cat&lt;/English&gt; 
        &lt;Spanish&gt;gato&lt;/Spanish&gt; 
     &lt;/Word&gt; 
     &lt;Word type="verb" level="1"&gt; 
        &lt;English&gt;speak&lt;/English&gt; 
        &lt;Spanish&gt;hablar&lt;/Spanish&gt; 
     &lt;/Word&gt; 
     &lt;Word type="adj" level="1"&gt; 
        &lt;English&gt;big&lt;/English&gt; 
        &lt;Spanish&gt;grande&lt;/Spanish&gt; 
     &lt;/Word&gt; 
  &lt;/Vocabulary&gt;
  </code></pre>
  
  <p>I created the xml file put it in the same directory as the classic asp file:</p>
  
  <pre><code>    &lt;%
  
      Set objXMLDoc = CreateObject("Microsoft.XMLDOM") 
      objXMLDoc.async = False 
      objXMLDoc.load("vocabulary.xml") 
  
      Set Node = objXMLDoc.documentElement.selectSingleNode("Word/Spanish")
      document.write(Node.text)
  
  %&gt;
  </code></pre>
  
  <p>But I get this:</p>
  
  <p>Microsoft VBScript runtime error '800a01a8'</p>
  
  <p>Object required: 'objXMLDoc.documentElement'</p>
  
  <p>/so-rms/reports/xmltest.asp, line 7</p>
  
  <p>What am I doing wrong?  They get the element.  I get the error.  Thanks.</p>
  
  <p>Edit:  I put this in:</p>
  
  <pre><code>If objXMLDoc.parseError.errorCode &lt;&gt; 0 Then
      response.write objXMLDoc.parseError.errorCode &amp; "ERROR CODE &lt;/br&gt;"
      response.write  objXMLDoc.parseError.reason &amp; "REASON CODE &lt;/br&gt;"
      response.write  objXMLDoc.parseError.line &amp; "LINE CODE &lt;/br&gt;"
  End If
  </code></pre>
  
  <p>and got:</p>
  
  <p>-2146697210ERROR CODE</p>
  
  <p>System error: -2146697210. REASON CODE</p>
  
  <p>0LINE CODE 
  tried from below:</p>
  
  <pre><code>dim path: path = Server.MapPath("vocabulary.xml")
  dim fso: set fso = CreateObject("Scripting.FileSystemObject")
  if not fso.FileExists(path) then
      Response.Write "path '" &amp; path &amp; "' not found"
  end if
  Set objXMLDoc = CreateObject("MSXML2.DOMDocument.3.0") 
  objXMLDoc.async = False 
  
  if not objXMLDoc.load("vocabulary.xml") then
      ' report loading error
       response.write "error"
  end if
  'objXMLDoc.load("vocabulary.xml") 
  If objXMLDoc.parseError.errorCode &lt;&gt; 0 Then
      response.write objXMLDoc.parseError.errorCode &amp; "ERROR CODE &lt;/br&gt;"
      response.write  objXMLDoc.parseError.reason &amp; "REASON CODE &lt;/br&gt;"
      response.write  objXMLDoc.parseError.line &amp; "LINE CODE &lt;/br&gt;"
  End If
  Set Node = objXMLDoc.documentElement.selectSingleNode("Word/Spanish")
  document.write(Node.text)
  </code></pre>
  
  <p>EDIT:</p>
  
  <p>I also changed the xml file to a URL of a working XML return (bing maps) and it worked.  So I guess it's the file.  Thanks.</p>