Re: MSXML Whitespace handling

Subject: Re: MSXML Whitespace handling
From: Mike Brown <mike@xxxxxxxx>
Date: Tue, 1 Aug 2000 16:53:01 -0700 (PDT)
Andrew Kimball wrote:
> I think it was the right decision for the vast majority of users.

For users of the MS DOM, sure. For users of the MS DOM when it is being used
as the basis of the stylesheet tree in XSLT processing, I think that Mike
Kay's statement still stands:

>> I accept the argument that it is legitimate to allow the user to mangle
>> the tree before passing it to XSLT, but it seems wrong to mangle it by
>> default.

Your response is:
> Users who need to preserve whitespace can always set 
> preserveWhiteSpace=true when loading the DOM, or use
> xml:space="preserve" to tag significant whitespace.

The XSLT 1.0 Recommendation doesn't contain a warning that xsl:text elements
should be written with xml:space="preserve" in order to ensure whitespace is
handled as one would expect. My guess, as I detailed in an email yesterday,
is that the spec was written without taking this into consideration.

Although the XML spec does make it clear that the parser has the option of
discarding insignificant whitespace, the XSLT spec makes it sound like I can
expect whitespace characters in my physical document to be preserved if
they're in xsl:text. However inaccurate that may be, it would seem to be
preferable to preserve whitespace if you know that the DOM will be used as
the basis of a stylesheet tree.

-Mike B.


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread