title: ASP classic: Object required: 'objContent.documentElement'
body: <p>I'm working on a project that uses ASP classic. I'm having trouble with this error:</p>
  
  <blockquote>
    <p>Microsoft VBScript runtime error '800a01a8'</p>
    
    <p>Object required: 'objContent.documentElement'</p>
    
    <p>/muhproject/includes/clsTransform.asp, line 138</p>
  </blockquote>
  
  <p>How do I include <code>objContent.documentElement</code> into the project as the requirement needs?</p>
  
  <p>File's line 138 is as follows:</p>
  
  <pre><code>'Attach fragment into pageContentXML
  objContent.documentElement.appendChild xDoc2.documentElement
  </code></pre>
  
  <p>EDIT: Here's the full function of the code</p>
  
  <pre><code>'TransformContent - accepts content in XML data, and contentXSL file path
      public function TransformContent(scriptNameFull, fragmentXML)
  
          fragmentXML = decodeUTF8(fragmentXML)
  
          '1. Load the content.html (as XML)
          Dim objContent
          set objContent = Server.CreateObject("Msxml2.DOMDocument.3.0")  
  
          Dim contentXSLSpec
          contentXSLSpec = rootRel &amp; "/muhproject/template/page/content.xsl"  'this is fixed
  
          objContent.async = false
          objContent.validateOnParse = false
          objContent.load( server.MapPath(scriptNameFull) )
  
          '2. Load fragmentXML XML fragment
          Dim xDoc2
          set xDoc2 = Server.CreateObject("Msxml2.DOMDocument.3.0")
          xDoc2.Async = false
          xDoc2.resolveExternals = false
          xDoc2.validateOnParse = false
          xDoc2.loadXML(fragmentXML)
  
  
          '3. Attach fragment into pageContentXML
          objContent.documentElement.appendChild xDoc2.documentElement
  
          Dim objXSL
          set objXSL = Server.CreateObject("Msxml2.DOMDocument.3.0")
  
          objXSL.async = false
          objXSL.validateOnParse = false
  
          objXSL.load( server.mapPath(contentXSLSpec) )
  
          '3. Do the transformation
  
          Dim retVal
          retVal = objContent.transformNode(objXSL.documentElement)
  
          set objContent = nothing
          set xDoc2 = nothing
          set objXSL = nothing
  
          TransformContent = retVal
  
      end function
  </code></pre>