GNOME Bugzilla – Bug 739993
elements mark xml:space="preserve" have space stripped
Last modified: 2015-09-27 16:41:51 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.
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:~$
Already fixed in master: https://git.gnome.org/browse/libxslt/commit/?id=7cb08dacadf7e1cf88ee2f45815251b61bffcde6