MSXML vs. Saxon: different handling of tabs & newlines
I am observing an interesting difference in the way MSXML and Saxon are treating tabs and newlines in my XML instance when viewing the resulting HTML. The XML instance looks much like this (I've put the whitespace characters in [brackets]): <X>[nl] [tab]<Title>Text</Title>[nl] </X>[nl] Here are the rules that handles those two elements: <xsl:template match="X"><xsl:apply-templates/></xsl:template> <xsl:template match="Title"><h1><xsl:apply-templates/></h1></xsl:template> When I transform using Saxon, I get newlines and tab characters in the HTML (viewable only in the source, of course), which I believe is correct since they are part of X's content (the instance is merely well-formed, so there's no chance of "knowing" X is not mixed content). When I transform using IE, XML Spy gives me two choices (text or XML output). When I specify "text", the result is this: <?xml version="1.0" encoding="UTF-16"?><h1 xmlns:fo="http://www.w3.org/1999/XSL/Format">Text</h1> When I specify "XML", the result is this: <?xml version="1.0" encoding="UTF-16"?>[nl] <h1 xmlns:fo="http://www.w3.org/1999/XSL/Format">Text</h1>[nl] With IE, I can change the XML instance to the following and get exactly the same results: <X><Title>Text</Title></X> Is this merely different (but correct) behaviour on the part of IE, or is it wrong? Thanks! -- Andrew Webber HoC PRISM project WebbeA@xxxxxxxxxx 613-943-7887 cell: 613-797-8123 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