W3C home > Mailing lists > Public > xproc-dev@w3.org > January 2011

Re: p:document-template in Calabash: bug?

From: Florent Georges <fgeorges@fgeorges.org>
Date: Thu, 13 Jan 2011 13:15:20 +0100
Message-ID: <AANLkTi=6J-_yvpvVWvX81Vy24eXTj3oebehsjqfR6gm7@mail.gmail.com>
To: vojtech.toman@emc.com
Cc: xproc-dev@w3.org
On 13 January 2011 11:44, ? wrote:

> ...and the pipeline added to the test suite:

> http://tests.xproc.org/tests/optional/document-template-018.xml

  Thanks!  Incidentally, the comment does not appear when you open the
above link within a browser (which applies testcase.xsl because of the
xml-stylesheet PI), because the comment is copied verbatim (so the
HTML renderer does not render it).  Which does not show the point of
this test then.  I suggest to add the following template rules to the
mode "quote" in testcase.xsl:

<xsl:template match="comment()" mode="quote">
  <xsl:text>&lt;!--</xsl:text>
  <xsl:value-of select="."/>
  <xsl:text>--></xsl:text>
</xsl:template>

<xsl:template match="processing-instruction()" mode="quote">
  <xsl:text>&lt;?</xsl:text>
  <xsl:value-of select="name()"/>
  <xsl:text> </xsl:text>
  <xsl:value-of select="."/>
  <xsl:text>?></xsl:text>
</xsl:template>

  I would as well change the last template rule in that styhlesheet:

<xsl:template match="comment()|processing-instruction()|text()">
  <xsl:copy/>
</xsl:template>

into:

<xsl:template match="text()">
  <xsl:copy/>
</xsl:template>

<xsl:template match="comment()">
  <xsl:text>&lt;!--</xsl:text>
  <xsl:value-of select="."/>
  <xsl:text>--></xsl:text>
</xsl:template>

<xsl:template match="processing-instruction()">
  <xsl:text>&lt;?</xsl:text>
  <xsl:value-of select="name()"/>
  <xsl:text> </xsl:text>
  <xsl:value-of select="."/>
  <xsl:text>?></xsl:text>
</xsl:template>

  I am not 100% sure this one is needed though.

  Regards,

-- 
Florent Georges
http://fgeorges.org/
Received on Thursday, 13 January 2011 12:16:13 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 13 January 2011 12:16:14 GMT