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 107165 - numerous cdatas using cdata-section-elements
numerous cdatas using cdata-section-elements
Status: VERIFIED INCOMPLETE
Product: libxslt
Classification: Platform
Component: general
1.0.24
Other Windows
: Normal normal
: ---
Assigned To: Daniel Veillard
Daniel Veillard
Depends on:
Blocks:
 
 
Reported: 2003-02-27 02:11 UTC by Matt Oshry
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Matt Oshry 2003-02-27 02:11:44 UTC
given the .xml and .xslt below, libxslt produces numerous cdata rather 
than enclosing the specified element in a cdata.

<grammar><![CDATA[<f]]><![CDATA[ "1234]]><![CDATA["> ]]></grammar>

Both sablotron and msxml produce a single enclosing cdata.

<grammar><![CDATA[<f "1234"> ]]></grammar>

<!-- .xml -->
<grammar>
  <key name="f" value="1234"/>
</grammar>

<!-- .xslt -->
<xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0">

<xsl:output method="xml" omit-xml-declaration="yes"/>

<xsl:output cdata-section-elements="grammar"/>

<xsl:template match="/">
  <xsl:apply-templates select="/grammar" />
</xsl:template>

<xsl:template match="grammar">
<grammar>
  <xsl:apply-templates select="key" />
</grammar>
</xsl:template>

<xsl:template match="key">
<xsl:text disable-output-escaping="yes">&lt;</xsl:text><xsl:value-of 
select="@name"/> "<xsl:value-of select="@value"/><xsl:text disable-output-
escaping="yes">"&gt; </xsl:text>
</xsl:template>

</xsl:stylesheet>
Comment 1 Daniel Veillard 2003-02-27 12:02:01 UTC
  You're asking to output 3 differnt items which cannot be
merged logically:
   - a text segment which must not be escaped
   - a text segment generated by two value-of results and
     a text string embedded in thge stylesheets, all of
     them subject to escaping and who can them be groupped
   - a text segment which must not be escaped
whether you can expect them to be glued together when generated
within a CDATA section is unclear from the spec. I would say again
to drop your disable-output-escaping tricks if you want portable
code.
I'm not sure this can really be considered a bug which should be
fixed. What does Saxon and Xalan generate on the same input ?

Daniel
Comment 2 Daniel Veillard 2003-08-11 10:50:36 UTC
No answer, gug gets closed now,

Daniel