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 321505 - Multiple contiguous CDATA in output
Multiple contiguous CDATA in output
Status: RESOLVED FIXED
Product: libxslt
Classification: Platform
Component: general
1.0.10
Other All
: Normal minor
: ---
Assigned To: kbuchcik
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2005-11-15 08:51 UTC by Jean-Luc Meunier
Modified: 2006-07-14 16:29 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jean-Luc Meunier 2005-11-15 08:51:58 UTC
Please describe the problem:
Hi,
My XSLT stylesheet produces strange results when it comes to CDATA.  
Instead of encapsulating all the data into one CDATA, I see many contiguous CDATA


Steps to reproduce:
1. File data.xml:
<doc>
  <text>blabla</text>
  <text>turlututu</text>
  <text>chapeau pointu</text>
</doc>

2. the cdata.xsl:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="xml" cdata-section-elements="doc" indent="yes"/>
  <xsl:template match="doc">
    <doc>
      <xsl:apply-templates/>
    </doc>
  </xsl:template>
  <xsl:template match="text">
    <xsl:value-of select="."/>
  </xsl:template>
</xsl:stylesheet>



Actual results:
"xsltproc.exe cdata.xsl data.xml" produces:
<?xml version="1.0"?>
<doc><![CDATA[
  blabla]]><![CDATA[
  turlututu]]><![CDATA[
  chapeau pointu]]><![CDATA[
]]></doc>


Expected results:
<?xml version="1.0"?>
<doc><![CDATA[
  blabla
  turlututu
  chapeau pointu
]]></doc>


Does this happen every time?
yes

Other information:
I'm under gygwin
> xsltproc --version
Using libxml 20616, libxslt 10112-CVS964 and libexslt 810-CVS964
xsltproc was compiled against libxml 20615, libxslt 10112 and libexslt 810
libxslt 10112 was compiled against libxml 20616
libexslt 810 was compiled against libxml 20616
Comment 1 kbuchcik 2006-06-19 16:14:04 UTC
The responsible code for this is in xsltCopyText(), where CDATA-section
nodes are created, without merging of adjacent CDATA-section nodes.
Comment 2 kbuchcik 2006-07-14 16:29:22 UTC
Fixed in CVS HEAD now.

Probably this fix could produce some sideeffects when serializing
"disable-output-escaping" text nodes into CDATA sections.