RE: [xslt] XSL and multiple contiguous CDATA



I found another workaround which works fine:

- the first transfo creates PCDATA into the <content> tag

- the second transfo is a XSl copy transfo which simply requires CDATA into the <content> tag.

 

This works fine from Python,

 

Still, any comments are welcome with respect to the behavior of xsltproc and the difference with the same XSL ran from Python.

 

Thanks

 

JL

 


From: xslt-bounces gnome org [mailto:xslt-bounces gnome org] On Behalf Of Meunier, Jean-Luc
Sent: Monday, November 14, 2005 3:35 PM
To: xslt gnome org
Subject: [xslt] XSL and multiple contiguous CDATA

 

Hi,

 

My XSLT stylesheet produces strange results when it comes to CDATA. And in Python it’s getting worse.

 

First, instead of encapsulating all the data of my <content> element into one CDATA, I see many contiguous CDATA:

(My stylesheet says at the beginning:  <xsl:output method="xml" cdata-section-elements="content" indent="yes"/>  )

 

<content><![CDATA[Contract Change Order]]><![CDATA[

Application and Certificate for Payment]]><![CDATA[

Progress Schedule and Report]]><![CDATA[

Inventory of Stored Materials]]> </content>

 

It seems that because multiple templates generate the data of the <content> element, there are many CDATA.

BTW, Saxon creates only one CDATA

 

As a workaround, I pass the following additional XSLT:

  <xsl:output method="xml" cdata-section-elements="content" indent="yes"/>

  <xsl:template match="@*|node()">

    <xsl:copy>

      <xsl:apply-templates select="@*|node()"/>

    </xsl:copy>

  </xsl:template>

 

Then contiguous CDATA are merged. Ok.

 

**BUT**, my really big problem is that this workaround doesn’t work in Python. The workaround XSL keeps things unchanged.

 

Any idea/help would be really appreciated,

 

Thanks

 

JL



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