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

x:param as child of x:context fails #35

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Steps to reproduce the problem:

copy attached files dtbook2latexBreaks.xspec and dtbook2latexTrimmed.xsl to 
your_xspec_installation_directory.
cd your_xspec_installation_directory
./xspec.sh dtbook2latexBreaks.xspec

Error generated:

Error on line 465 of generate-common-tests.xsl:
  x:XSPEC002: Unhandled node in x:compile mode: dtb:pagenum
  at xsl:apply-templates (file:generate-common-tests.xsl#416)
     processing x:context/dtb:pagenum[1]
  at xsl:apply-templates (file:generate-xspec-tests.xsl#249)
     processing x:context/x:param[1]
  at xsl:call-template name="x:output-scenario" (file:generate-common-tests.xsl#368)
  at xsl:apply-templates (file:generate-common-tests.xsl#273)
     processing /x:description/x:scenario[1]
  at xsl:call-template name="x:compile-scenarios" (file:generate-xspec-tests.xsl#83)
  at xsl:apply-templates (file:generate-common-tests.xsl#41)
     processing /x:description
  at xsl:call-template name="x:generate-tests" (file:generate-xspec-tests.xsl#39)
Transformation failed: Run-time errors were reported

*** Error compiling the test suite

Version of the product:
- svn trunk

Operating system
- Linux 2.6.32-24-generic #42-Ubuntu SMP

This is a properly failing version of the thread 
<http://groups.google.com/group/xspec-users/browse_thread/thread/f622dd36dab6d41
0>

Original issue reported on code.google.com by sbs....@gmail.com on 15 Sep 2010 at 4:02

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for the report!  I think I see now.  You try to fix the
value of a *stylesheet parameter*, while x:context/x:param has
been intended to set a *template parameter*.  That is, if you
have the following template rule:

    <xsl:template match="elem">
       <xsl:param name="p"/>
       ...

then normally you can use the following to test it with an empty
matching element and the string 'value' bound to the parameter:

    <t:context>
       <t:param name="p" select="'value'"/>
       <elem/>
    </t:context>

This was not supported, but fixed in revision 178!

I think there is no way to set different values for global
parameters within the same test suite.  That's definitely a
limitation, but I can't think of neither a good syntax to
represent that in the test suites, nor an obvious implementation
in XSLT.

Original comment by fgeorges on 15 Sep 2010 at 7:05

GoogleCodeExporter commented 9 years ago
Thank you for all the fixes, Florent!

Here's a comment by Jeni Tennison stating the same limitation: 
<http://inasmuch.as/2008/06/09/why-use-more-that-xslt-for-testing-xslt/#comment-
3645>

Bernhard

Original comment by sbs....@gmail.com on 17 Sep 2010 at 2:20