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

RE: preserve-space

Subject: RE: preserve-space
From: Mike Brown <mbrown@xxxxxxxxxxxxx>
Date: Wed, 10 Nov 1999 15:33:50 -0700
clay rowland
Clay Rowland wrote:
> I am having a hard time understanding how to implement this 
> tag.  The spec says to list the elements that I would like
> to preserve space for like this: 
> <xsl:preserve-space elements="..."/>
> 
> is the list of elements just space delimited like so:  
> elements="elem1 elem2 elem3"?

Yes, the spec says so at http://www.w3.org/TR/xslt#strip.

"For source documents, the set of whitespace-preserving element names is
specified by xsl:strip-space and xsl:preserve-space top-level elements.
These elements each have an elements attribute whose value is a
whitespace-separated list of NameTests." 

A NameTest is an asterisk or element name, with or without a prefix.

"Initially, the set of whitespace-preserving element names contains all
element names."

<xsl:preserve-space> is for overriding this initial set with a subset. What
are being preserved are the child text nodes (of these elements) that
contain nothing but whitespace.

> what i would really like is to preserve the white space 
> of the entire xsl style sheet as well as the xml elements.

"For stylesheets, the set of whitespace-preserving element names consists of
just xsl:text."

In other words, whitespace-only text nodes are always stripped from the
stylesheet, except for those that are children of <xsl:text> elements.

Post a brief example XML and XSL document, what XSL processor you're using,
and what is it about the output that you want to change.

-Mike


 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.