[xslt] XSL and multiple contiguous CDATA



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:apply-templates select="@*|node()"/>




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,





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