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 314727 - indent="yes" doesn'e indent
indent="yes" doesn'e indent
Status: RESOLVED FIXED
Product: libxslt
Classification: Platform
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2005-08-28 19:08 UTC by Oleg Paraschenko
Modified: 2009-03-26 15:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
empty-value-of.diff (568 bytes, patch)
2005-11-29 18:05 UTC, Bart Martens
none Details | Review

Description Oleg Paraschenko 2005-08-28 19:08:08 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.
Comment 1 Bart Martens 2005-11-29 18:05:36 UTC
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.
Comment 2 Oleg Paraschenko 2006-09-08 03:59:57 UTC
Seems fixed in the CVS version of 8 Sep 2006.
Comment 3 Alejandro 2009-03-26 15:08:41 UTC
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.