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

RE: output/@indent="yes" and *[@xml:space="preserve"]

Subject: RE: output/@indent="yes" and *[@xml:space="preserve"]
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Tue, 4 Feb 2003 23:32:30 -0000
xml indent yes
Oh dear, I think you're right. The spec says in effect that whitespace
shouldn't be added where <xsl:strip-space> wouldn't cause it to be
stripped: which is the case when xml:space="preserve" applies. It also
says that it shouldn't be added inside an xsl:text element - a rather
odd provision which seems to special-case the output of stylesheets.

Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx 

> -----Original Message-----
> From: Gunther Schadow [mailto:gunther@xxxxxxxxxxxxxxxxxxxxxx] 
> Sent: 04 February 2003 20:33
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: xsl:output/@indent="yes" and *[@xml:space="preserve"]
> 
> 
> Hi,
> 
> suppose I run the following transform (on anything)
> 
> <xsl:transform version="1.0"
>      xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>    <xsl:output method="xml" indent="yes"/>
>    <xsl:strip-space elements="*"/>
>    <xsl:template match="/">
>      <root>
>        <span xml:space="preserve"><xsl:text>&#xA;</xsl:text></span>
>      </root>
>    </xsl:template>
> </xsl:transform>
> 
> In Saxon this produces the following output
> 
> <?xml version="1.0" encoding="utf-8"?>
> <root>
>     <span xml:space="preserve">
> 
>     </span>
> </root>
> 
> however, I submit this is not correct, or at least not what I 
> would expect. If space is to be preserved on the span 
> element, then I would hope that no space is added either. IMO 
> the output should be:
> 
> <?xml version="1.0" encoding="utf-8"?>
> <root>
>     <span xml:space="preserve">
> </span>
> </root>
> 
> i.e., there should be a single newline only, even though that 
> somewhat messes up the XML prettyness.
> 
> Is this something that Saxon just happens to get wrong or is 
> this something that the XSLT spec leaves open to 
> interpretation, or does the XSLT spec actually require this 
> behavior? If the latter is true, how can one preserve space 
> precisely on certain elements without having to choose 
> xsl:output/@indent="no"?
> 
> thanks,
> -Gunther
> 
> 
> -- 
> Gunther Schadow, M.D., Ph.D.                    
> gschadow@xxxxxxxxxxxxxxx
> Medical Information Scientist      Regenstrief Institute for 
> Health Care
> Adjunct Assistant Professor        Indiana University School 
> of Medicine
> tel:1(317)630-7960                         
> http://aurora.regenstrief.org
> 
> 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.