Output in XSLT
Posted: Fri Aug 25, 2006 10:07 pm
I'm trying to do templates with XML & XSLT. However some of the data is HTML or Javascript and not plain text. For example the comments element in the XML may contain code.
Displays as <b>Comments</b>, not Comments.
On Google I found the xsl:copy-of technique, which does the job if I don't use CDATA; however the HTML in the comments could easily contain code that would not be XML compatible, so I need to be able mass quote it in the XML without having the comments quoted when they're displayed.
Basically I need to be able to output HTML or Javascript data without having it interpreted by the XML interpreter.
Code: Select all
<comments><![CDATA[<b>Comments</b>]]></comments>On Google I found the xsl:copy-of technique, which does the job if I don't use CDATA; however the HTML in the comments could easily contain code that would not be XML compatible, so I need to be able mass quote it in the XML without having the comments quoted when they're displayed.
Basically I need to be able to output HTML or Javascript data without having it interpreted by the XML interpreter.