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

xml:output indent="yes" wins over xsl:preserve-space/

Subject: xml:output indent="yes" wins over xsl:preserve-space/xsl:strip-space?
From: David Sewell <dsewell@xxxxxxxxxxxx>
Date: Mon, 22 May 2006 11:12:53 -0400 (EDT)
xml output indent
I have an XSLT 2.0 script that I'm using to generate output with Saxon
8B, and I want confirmation that the behavior I'm getting is the
expected one.  It's not the behavior I want, but if it follows the
specs then I can't complain.

My script simply extracts all tables in an XML document and writes them
to a result document. In the source document, rows and cells are not
indented; I want them to be indented in the result document. However,
because cells can contain mixed content, I want space to be preserved
inside them.

This does not work:

   <xsl:output method="xml" indent="yes"/>
   <xsl:preserve-space elements="cell"/>

because it leads to output such as

   <cell>
      <i>some text</i>
   </cell>

The same output occurs if I use <xsl:strip-space> in place of
xsl:preserve-space. It seems, then, that xsl:output overrides
xsl:strip-space or xsl:preserve-space.

I can produce the output I want by adding "xml:space='preserve'"
as an attribute on all <cell> elements in the source. Is modifying the
source the only option I have?

DS

-- 
David Sewell, Editorial and Technical Manager
Electronic Imprint, The University of Virginia Press
PO Box 400318, Charlottesville, VA 22904-4318 USA
Courier: 310 Old Ivy Way, Suite 302, Charlottesville VA 22903
Email: dsewell@xxxxxxxxxxxx   Tel: +1 434 924 9973
Web: http://www.ei.virginia.edu/

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.