RE: [xsl] problem with processing CDATA tags in xml

Subject: RE: [xsl] problem with processing CDATA tags in xml
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Thu, 8 Apr 2010 12:44:01 +0100
> I have a problem processing following tag:
> 
> The original tag before transformation was:
> <Value><![CDATA[G<sub>p(max)</sub> is the maximum power gain, 
> if K > 1. If K < 1 then G<sub>p(max</sub> = MSG.]]></Value>
> 
> 
> My customer wants to use <sub> and <sup> tags so in the 
> rendition it's formatted nicely.
> 

An excellent idea. If you want <sub> and <sup> to be recognized as tags, all
they need to do is get rid of the CDATA:

<Value>G<sub>p(max)</sub> is the maximum power gain, 
  if K > 1. If K &lt; 1 then G<sub>p(max</sub> = MSG.</Value>

The only possible reason for having the CDATA is to prevent the <sub> and
<sup> being recognized as tags, so if you want them treated as tags, just
cut out the CDATA.

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 

Current Thread