[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: problem with processing CDATA tags in xml
Ok.... I need to clarify one thing... Their product schema does not allow a <Value> to have subtags... That's why they use CDATA. And in my opinion that's not so bad since from a data point of view these html tags are pure a rendition thing. But basically I see 2 options from the responses: (1): Use cdata-sections attribute on <xsl:output> (2): make changes to the schema for all elements which may have html tags as children I still see a problem with (1)... in the end when serializing to html I still want to disable-output-escaping so the browser will recognize <sub> and <sup> as tags instead of plain text... but then the greater then '>' will result in invalid xml. And I'm not sure if (2) will be accepted since this will involve quite a bit of work to implement the changes. Kind regards, Robby -----Original Message----- From: Michael Kay [mailto:mike@xxxxxxxxxxxx] Sent: Thursday, April 08, 2010 1:44 PM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: RE: problem with processing CDATA tags in xml > 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 < 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|