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

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 UTC