GNOME Bugzilla – Bug 314727
indent="yes" doesn'e indent
Last modified: 2009-03-26 15:08:41 UTC
Consider XSLT: [code] <xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" version = "1.0"> <!-- --> <xsl:output indent="yes"/> <xsl:template match="/"> <z> <z1/> <xsl:value-of select="/.."/> <z2/> </z> </xsl:template> </xsl:stylesheet> [/code] xsltproc result is: [code] <?xml version="1.0"?> <z><z1/><z2/></z> [/code] Expected result is: [code] <?xml version="1.0"?> <z> <z1/> <z2/> </z> [/code] It seems that empty text nodes are not ignored during indenting.
Created attachment 55380 [details] [review] empty-value-of.diff See http://www.w3.org/TR/xslt : "The xsl:value-of element is instantiated to create a text node in the result tree. The required select attribute is an expression; this expression is evaluated and the resulting object is converted to a string as if by a call to the string function. The string specifies the string-value of the created text node. If the string is empty, no text node will be created. The created text node will be merged with any adjacent text nodes." The patch modifies xsltValueOf to no longer create empty text nodes when the result of value-of is an empty string.
Seems fixed in the CVS version of 8 Sep 2006.
the problem seems to be still open. I'm using Using libxml 20703, libxslt 10124 and libexslt 813 xsltproc was compiled against libxml 20701, libxslt 10124 and libexslt 813 libxslt 10124 was compiled against libxml 20701 libexslt 813 was compiled against libxml 20701 on Win32. Just the described behavior.