kszbcss / xspec

Private backup of the xspec project at google code, as google code is going to disappear.
MIT License
1 stars 0 forks source link

Cannot test a named template with a particular context #66

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The source XSLT: 

<xsl:template name="copy-content">
  <xsl:copy-of select="."/>
</xsl:template>

The scenario: 

<x:scenario>
  <x:context select="//p">
    <sec>
      <p>text</p>
    </sec>
  </x:context>

  <x:call template="copy-content"/>

  <x:expect>
    <p>text</p>
  </x:expect>
</x:scenario>

The expected output is: 
<p>text</p>

But the error with the following message is thrown: "Variable $context has not 
been declared". When I look at the generated XSLT I find that the $context 
variable is generated in the default namespace, while it should be 
$impl:context:

<xsl:variable name="impl:context" select="$impl:context-doc/(//p)"/>

<xsl:for-each select="$context">
  <xsl:call-template name="copy-content"/>
</xsl:for-each>

The version of the product is: XSpec 0.4.0 Release Candidate 1.
The issue is not environment-dependent.

Original issue reported on code.google.com by sha...@intelliarts.com on 28 Feb 2014 at 12:56

GoogleCodeExporter commented 9 years ago
+1, one of our users also stumbled upon this problem.

Original comment by raducor...@gmail.com on 2 Sep 2014 at 6:08