Subject: Re: [xsl] Result still indented despite indent="no" From: Mukul Gandhi <mukul_gandhi@xxxxxxxxx> Date: Tue, 22 Feb 2005 00:41:35 -0800 (PST) |
Hi David, You are saying IE 6's XSLT processor(MSXML 3.0) is compliant to 1.0 spec. Except you are not 100% sure whether IE's XML parser is 100% conformant. It just behaves a bit different than other XML parsers(as Mr. Kay said). Please consider this example.. The XML file is - <?xml-stylesheet href="test.xsl" type="text/xsl"?> <pre> <b>bold</b> <i>italic</i> </pre> The XSLT file is - <?xml version="1.0" encoding="iso-8859-1"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="text"/> <xsl:template match="/"> <xsl:value-of select="count(/pre/child::node())"/> </xsl:template> </xsl:stylesheet> The output in IE 6 is 2. Which according to you is conformant. Just that default value of whitespace preserving behaviour is "false", for MSXML's XML parser. Which we can make in script as "true". But lets say, the XML file is - <?xml-stylesheet href="test.xsl" type="text/xsl"?> <pre xml:space="preserve"> <b>bold</b> <i>italic</i> </pre> (Please not the use of xml:space="preserve" at top level element). And XSLT is same.. Now output is 5(as produced by Saxon and Xalan in default mode). I am wondering, whether writing XML like this (using xml:space="preserve") would solve Mr. Holman's problem.. I have another doubt.. xml:space can have values "default" or "preserve". That would mean, default behaviour should be of whitespace stripping! This is exactly what IE is doing? Is'nt it fine! And IE is preserving whitespaces fine in presence of xml:space="preserve".. Then the only problem I can see with IE is.. I cannot control whitespaces in IE *from XSLT* (using preserve-space and strip-space). I have to do it from source XML(using xml:space attribute). Or I have to write a script.. How do you rate this characteristic of IE from developer ease and cross-browser implementation point of view? Regards, Mukul --- David Carlisle <davidc@xxxxxxxxx> wrote: > Thank you David for explanation. It would > therefore > mean, xsl:preserve-space is not usable in IE? > > > xsl:preserve-space isn't a lot of use anyway, I'm > fairly sure I have > never used it, and I've been using xslt since the > first drafts came out > in 1998. The default is anyway to preserve all white > space nodes on > input, so the only use I can think of is if you have > used > xsl:strip-space with a * wildcard and then to try to > undo this for some > specific elements. > > David __________________________________ Do you Yahoo!? Read only the mail you want - Yahoo! Mail SpamGuard. http://promotions.yahoo.com/new_mail
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Result still indented des, David Carlisle | Thread | Re: [xsl] Result still indented des, David Carlisle |
Re: [xsl] OT (browser standards), Mukul Gandhi | Date | Re: [xsl] java extension element an, Keith Lynch |
Month |