title: Exporting UFT 12 results into html throws the error “A reference to variable or parameter 'IDS_BC' cannot be resolved.”
body: <p>We have recently upgraded from QTP 11 to UFT 12.  The vbscript I used for QTP 11 worked great, but it is not running with UFT 12.  It says </p>
  
  <blockquote>
    <p>"A reference to variable or parameter 'IDS_BC' cannot be resolved.”  </p>
  </blockquote>
  
  <p>It says it might be undefined or out of scope. IDS_BC appears to be in the <code>PDetails.xsl</code> file for UFT, but I do not want to modify that file.  Any help would be greatly appreciated.  Thank you.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>Set xmlSource = CreateObject("MSXML.DOMDocument")
  Set xmlXForm = CreateObject("MSXML.DOMDocument")
  
  xmlSource.validateOnParse = True
  xmlXForm.validateOnParse = True
  xmlSource.async = False
  xmlXForm.async = False
  
  xmlSource.Load "\\cpsrv01\wwwroot\QA\QTPScripts\Curriculum_Pathways\TestResults\Server Actions\AppServers\Report\Results.xml"
  
  If Err.Number &lt;&gt; 0 Then
      strErr = Err.Description &amp; vbCrLf
      strErr = strErr &amp; xmlSource.parseError.reason &amp; " line: " &amp; xmlSource.parseError.Line &amp; " col: " &amp; xmlSource.parseError.linepos &amp; " text: " &amp; xmlSource.parseError.srcText
      MsgBox strErr, vbCritical, "Error loading the XML"
  End If
  
  xmlXForm.Load "C:\Program Files (x86)\HP\Unified Functional Testing\dat\PDetails.xsl"
  
  If Err.Number &lt;&gt; 0 Then
      strErr = Err.Description &amp; vbCrLf
      strErr = strErr &amp; xmlSource.parseError.reason &amp; " line: " &amp; xmlSource.parseError.Line &amp; " col: " &amp; xmlSource.parseError.linepos &amp; " text: " &amp; xmlSource.parseError.srcText
      MsgBox strErr, vbCritical, "Error loading the Transform"
  End If
  
  strResult = xmlSource.transformNode(xmlXForm)
  
  If Err.Number &lt;&gt; 0 Then
      strErr = Err.Description &amp; vbCrLf
      strErr = strErr &amp; xmlSource.parseError.reason &amp; " line: " &amp; xmlSource.parseError.Line &amp; " col: " &amp; xmlSource.parseError.linepos &amp; " text: " &amp; xmlSource.parseError.srcText
      MsgBox strErr, vbCritical, "Error loading the Transform"
  End If
  
  Set fso = CreateObject("Scripting.FileSystemObject")
  strPath = "\\cpsrv01\wwwroot\QA\QTPScripts\Curriculum_Pathways\TestResults\Server Actions\AppServers\Report\TestResults_" &amp; TimeStamp &amp; ".html"
  Set file = fso.opentextfile(strPath, ForWriting, True)
  file.write strResult
  Set file2 = fso.GetFile(strPath)
  file2.copy ("\\cpsrv01\wwwroot\QA\QTPScripts\Curriculum_Pathways\AppServerResults\")
  file.close
  </code></pre>
  
  <p>Here is the .xsl</p>
  
  <pre><code>&lt;xsl:template match="Doc"&gt;
  &lt;xsl:choose&gt;
      &lt;xsl:when test="@type = 'BC'"&gt;  
          &lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;
              &lt;tr&gt;&lt;td class="iteration_head" bgcolor="gray"&gt;&lt;xsl:copy-of select="$IDS_BC"/&gt;&lt;xsl:value-of select="DName"/&gt;
              &lt;xsl:if test="@BCIter"&gt;(Iteration &lt;xsl:value-of select="@BCIter"/&gt;) &lt;/xsl:if&gt;
              &lt;/td&gt;&lt;/tr&gt;              
              &lt;tr&gt;
  </code></pre>