How to access variable in CDATA from XSLT?

I got the solution for this...FYI for everyone xsl:text disable-output-escaping="yes.

I got the solution for this...FYI for everyone...

1 The problem with this approach is that you may end up with invalid XML. Also, some XSLT processors (for example the one built into Mozilla Firefox) will not respect the disable-output-escaping attribute. – Lucero Feb 15 '10 at 13:00 @Lucero: How can you end up with invalid XML?

Unless the variable contains > of course. – Tomalak Feb 15 '10 at 16:57 @Tomalak, in this case exactly with the > case. However, my comment was geared more towards the use of disable-output-escaping in general.

– Lucero Feb 16 '10 at 10:58.

If you want to include CDATA sections in your output, you should use the cdata-section-elements atribute of xsl:output. This is a list of element names. Any such elements will have their text content wrapped in CDATA.

CDATA is just text like any other element contents... But using the xsl:output element you should be able to specify which elements are to be written as CDATA with the cdata-section-elements attribute. EDIT: Now that there is a valid sample, I guess you mean this.

Yes... I need to access variable from CDATA > – Amit Feb 15 '10 at 11:03 The CDATA cannot contain tags. Therefore you must end the CDATA section, add the tag, and start another CDATA section. – Lucero Feb 15 '10 at 12:58 @Amit: as per the spec a XML processor must handle CDATA sections the same way they treat simple text.So if some tool only accepts the data inside CDATA, then that tool is broken.

– Joachim Sauer Feb 15 '10 at 13:00 To make any kind of sense, you need to declare disable-output-escaping="yes" in a CDATA section. Also there is no CDATA in an attribute value, AFAIK. – Tomalak Feb 15 '10 at 16:52.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions