[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] xsl:for-each and xml:space with text-nodes inbetween
Hi, Does someone know what an XSLT 1.0 processor is expected to do if the immediate child-node of an xsl:for-each is a whitespace-only text node, which is preserved by xml:space? Should any text-node, regardless if it's whitespace-only or not, be reported as invalid at such a position? Example Stylesheet: <?xml version='1.0'?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <foo> <!-- There's whitespace between xsl:for-each and xsl:sort. --> <xsl:for-each select="/foo/bar" xml:space="preserve"> <xsl:sort /><xsl:value-of select="."/></xsl:for-each> </foo> </xsl:template> </xsl:stylesheet> Input: <?xml version="1.0"?> <foo> <bar>b</bar> <bar>c</bar> <bar>a</bar> </foo> Using the MSXML .NET Processor, I get the following result: <?xml version='1.0' encoding='utf-8' ?> <foo> a b c</foo> If I change the whitespace-only text-node to contain a letter: ... <xsl:for-each select="/foo/bar" xml:space="preserve">X<xsl:sort /><xsl:value-of select="."/></xsl:for-each> ... then an error is reported concerning the invalid position of xsl:sort inside xsl:for-each. I'm confused here. Was this maybe clarified in the XSLT 2.0 spec? Regards, Kasimier
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|