Re: [xsl] Result still indented despite indent="no"

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"?>

The XSLT file is -
<?xml version="1.0" encoding="iso-8859-1"?>

<xsl:output method="text"/>

<xsl:template match="/">
   <xsl:value-of select="count(/pre/child::node())"/>


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">

(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

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?


--- 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. 

Current Thread