xsl-list
[Top] [All Lists]

text(), whitespace, and nxslt

2005-10-19 11:39:06
XSLT 1.0

Given this stylesheet:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
  <xsl:output method="xml" version="1.0" encoding="UTF-8"
indent="yes"/>

  <xsl:template match="node()">
    <output>
      <test1>
        <xsl:value-of select="boolean(.)"/>
      </test1>
      <test2>
        <xsl:value-of select="boolean(text())"/>
      </test2>
      <test3>
        <xsl:value-of select="boolean(child::text())"/>
      </test3>
    </output>
  </xsl:template>

</xsl:stylesheet>

And this source file:

<ROOT>
    <!-- some whitespace -->
</ROOT>

I get values of true, true, true in nxslt
However, in the built in XMLSpy parser, msxsl, and saxon I get true,
false, false. If I use the parameter -xw (Strip non-significant
whitespace from source and stylesheet), the result from nxslt becomes
the same as the other parsers (true, false, false).

My question: Does nxslt consider whitespace as something that should
give a true when using boolean(text()), and is this conforming to spec;
or do the other processors strip out whitespace before processing?

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>