[xsl] Whitespace stripping in conjunction with PIs and comments

Subject: [xsl] Whitespace stripping in conjunction with PIs and comments
From: "Buchcik, Kasimier" <k.buchcik@xxxxxxxxxxxx>
Date: Thu, 13 Apr 2006 19:45:15 +0200
Hi,

Is the whitespace-stripping process, as described in [1], intended to
be applied before or after the processing-instruction nodes and
comment nodes inside a stylesheet's tree are "ignored"?

Example:

<?xml version='1.0'?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
  <xsl:output indent="yes"/>
  <xsl:template match="/">
    <foo>
      <bar> <?zoo x ?>1<?zoo x ?> </bar>
      <bar> <!-- zoo -->2<!-- zoo --> </bar>
      <boo><xsl:text> <!-- zoo -->3<?zoo x ?> </xsl:text></boo>
    </foo>
  </xsl:template>
</xsl:stylesheet>

Should the result be this...
<foo>
  <bar> 1 </bar>
  <bar> 2 </bar>
  <boo> 3 </boo>
</foo>

or this...
<foo>
  <bar>1</bar>
  <bar>2</bar>
  <boo> 3 </boo>
</foo>

or something different?

[1] http://www.w3.org/TR/xslt#strip

Regards,

Kasimier

Current Thread