If you want whitespace nodes stripped you should specify
<xsl:strip-space elements="*"/>
It's MSXML that's out of line on this one.

Michael Kay
Software AG
home: Michael.H.Kay@ntlworld.com
work: Michael.Kay@softwareag.com

-----Original Message-----
From: saxon-help-admin@lists.sourceforge.net [mailto:saxon-help-admin@lists.sourceforge.net] On Behalf Of Ytai Ben-Tsvi
Sent: 07 August 2002 11:30
To: Saxon Help List
Subject: [saxon] whitespace handling in saxon

Hi I have a question about whitespace stripping in Saxon. I created this simple 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"/>

       <xsl:template match="node() | @*">

             <xsl:if test="self::text() and normalize-space(.)=''">

                    <xsl:message terminate="no">Warning: whitespace encountered: '<xsl:value-of select="."/>'</xsl:message>



                    <xsl:apply-templates select="node() | @*"/>





It’s just an identity transformation, which warns anytime it encounters a whitespace text node. On Saxon 6.5.2/Crimson or Aelfred and also on other configurations including Xalan/Xerces Xalan/Crimson, etc. I keep getting warnings (the xml file is very simple and contains xsl:space=”default” in the root and nowhere else). Is this the expected behavior? Shouldn’t whitespace nodes be stripped before transformation occurs (spec. - sec. 3.4)?

BTW, MSXML does behave the way I would expect, but maybe it’s them who aren’t conformant.




Ytai  Ben-Tsvi

C T I Squared