[xsl] Losing white-space in mixed content

Subject: [xsl] Losing white-space in mixed content
From: Peter Flynn <peter@xxxxxxxxxxx>
Date: 05 May 2003 23:41:55 +0100
When processing two consecutive elements in mixed content separated by
white-space, using text output in XSLT, the white-space gets lost.  
This occurs using Saxon 6.5.2 under Red Hat 9: I haven't tested it with
anything else yet, but the sister stylesheet which output HTML keeps the
white-space as expected. Is this a bug or a feature of XSLT text-mode?

Minimal document:

<?xml version="1.0" encoding="iso-8859-1"?>
<para>Created using the <productname>DocBook</productname>
  <acronym>DTD</acronym> on 2003-05-05.</para>

Note the newline and indent space (added by psgml) between DocBook 
and DTD. Minimal stylesheet:

<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";

  <xsl:output method="text" encoding="iso-8859-1"/>
  <xsl:strip-space elements="*"/>

  <xsl:template match="/">

  <xsl:template match="para">

  <xsl:template match="productname">

  <xsl:template match="acronym">


Output from Saxon:

Created using the \product{DocBook}\acro{DTD} on 2003-05-05.


This looks wrong: the white-space in mixed content should be honoured
between the productname element and the acronym element. Both nsgmls
and rxp retain the newline and space tokens. Or have I missed something
arcane in the XSLT spec?


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

Current Thread