After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 739993 - elements mark xml:space="preserve" have space stripped
elements mark xml:space="preserve" have space stripped
Status: RESOLVED FIXED
Product: libxslt
Classification: Platform
Component: general
1.1.x
Other Linux
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2014-11-12 07:15 UTC by Paul Millar
Modified: 2015-09-27 16:41 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Paul Millar 2014-11-12 07:15:38 UTC
Specifying the xml:space attribute with value "preserve" should inform the XML parser that the white-space-only child text elements are to be kept.

It seems that xsltproc does not honour that attribute.

Here's a simple example to illustrate the problem:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/" xml:space="preserve">
<document>
    <value>isn't this boring</value>
</document>
</xsl:template>
</xsl:stylesheet>



Expected output:

paul@sparkplug:~$ xsltproc simple.xsl test.xml 
<document>
    <value>isn't this boring</value>
</document>
paul@sparkplug:~$ 


Actual output:

paul@sparkplug:~$ xsltproc simple.xsl test.xml 
<?xml version="1.0"?>
<document><value>isn't this boring</value></document>
paul@sparkplug:~$ 

Cheers,

Paul.
Comment 1 Paul Millar 2014-11-12 07:17:15 UTC
Sorry, forgot to mention this is with the current latest xsltproc from Debian sid.

paul@zitpcx6184:~$ dpkg-query -W libxslt1.1
libxslt1.1:i386 1.1.28-2+b2
paul@zitpcx6184:~$ xsltproc -version
Using libxml 20902, libxslt 10128 and libexslt 817
xsltproc was compiled against libxml 20902, libxslt 10128 and libexslt 817
libxslt 10128 was compiled against libxml 20902
libexslt 817 was compiled against libxml 20902
paul@zitpcx6184:~$
Comment 2 Nick Wellnhofer 2015-09-27 16:41:51 UTC
Already fixed in master:

https://git.gnome.org/browse/libxslt/commit/?id=7cb08dacadf7e1cf88ee2f45815251b61bffcde6