[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Result still indented despite indent="no"

Subject: Re: Result still indented despite indent="no"
From: Mukul Gandhi <mukul_gandhi@xxxxxxxxx>
Date: Tue, 22 Feb 2005 00:41:35 -0800 (PST)
pre xml space
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.