xsl-list
[Top] [All Lists]

[xsl] xml:output indent="yes" wins over xsl:preserve-space/xsl:strip-space?

2006-05-22 08:13:11
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(_at_)virginia(_dot_)edu   Tel: +1 434 924 9973
Web: http://www.ei.virginia.edu/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>