This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: RE: Saxon's handling of line breaks
- From: Mike Brown <mike at skew dot org>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Mon, 6 May 2002 16:31:28 -0600 (MDT)
- Subject: Re: RE: [xsl] Saxon's handling of line breaks
- Reply-to: xsl-list at lists dot mulberrytech dot com
Salvatore Mangano wrote:
> According to your explanation foo and bar should be seperated
> by whatever is enclosed in the xsl:text element.
That's correct. But the xsl:text element in the stylesheet *tree*
contains the LF only, regardless of the fact that the original
document contained CR+LF.
> In this case it should be a CRLF combination because the
> stylesheet was created in an editor that writes out CR+LF
> at the end of line.
No, the stylesheet tree is what is being processed, not the
document that the tree came from.
> However, after processing the stylesheet the CR was indeed
> stripped with saxon but not with xalan. Explain?
He did explain:
"Line breaks in the input document and the stylesheet are
automatically converted to a single NL character by the
XML parser - that's defined by the XML standard."
(I think he meant LF, not NL.)
Remember that the stylesheet is an XML document that is parsed
in order to provide input to the XSLT processor, just like the
source document.
Whatever XML parser you are using to feed input to Xalan
(Xerces, I assume) is misbehaving if it preserves the CRs.
It might be preserving them, but I suspect that it is really
just making a note that the input had CR+LF and then
serializing the result tree the same way, while internally,
it is only seeing LF.
- Mike
____________________________________________________________________________
mike j. brown | xml/xslt: http://skew.org/xml/
denver/boulder, colorado, usa | resume: http://skew.org/~mike/resume/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list