[xslt] CDATA-section-elements? Is this a bug?



Hi,

I posted the below message earlier this week.  Does anyone know if this is a bug?

Thanks,

Susan *****************************************************************

Hi,

I've tried using cdata-section-elements in the way I believe it is intended to be used but I don't think I am getting the correct results.

XML doc:

<?xml version="1.0" encoding="utf-8"?>
<operators>
  <compare><![CDATA[X < Y]]></compare>
  <compare>X &lt; Y</compare>
</operators>

XSL:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

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

  <xsl:template match="/">
    <xsl:copy-of select="." />
  </xsl:template>
</xsl:stylesheet>

Result using xsltproc:

<?xml version="1.0"?>
<operators>
  <compare><![CDATA[X < Y]]></compare>
  <compare>X &lt; Y</compare>
</operators>

Result using saxon:

<?xml version="1.0" encoding="utf-8"?><operators>
  <compare><![CDATA[X < Y]]></compare>
  <compare><![CDATA[X < Y]]></compare>
</operators>

Result using Xalan:

<?xml version="1.0" encoding="UTF-8"?>
<operators>
  <compare><![CDATA[X < Y]]></compare>
  <compare><![CDATA[X < Y]]></compare>
</operators>

I believe the correct way to output the second <compare> element is to contain CDATA as is done using saxon and xalan.

Is this a bug?

Thanks,

Susan Cline



Do you Yahoo!?
U2 on LAUNCH - Exclusive medley & videos from Greatest Hits CD

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]