Re: RE: Saxon's handling of line breaks
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
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