Subject: RE: Whitespace stripping in conjunction with PIs and comments
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Thu, 13 Apr 2006 19:03:53 +0100
|
XSLT 2.0 clarifies the intent:
http://www.w3.org/TR/xslt20/#stylesheet-stripping
Michael Kay
http://www.saxonica.com/
> -----Original Message-----
> From: Buchcik, Kasimier [mailto:k.buchcik@xxxxxxxxxxxx]
> Sent: 13 April 2006 18:45
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Whitespace stripping in conjunction with PIs
> and comments
>
> 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
|