Output in XSLT

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
GameMusic
Forum Newbie
Posts: 24
Joined: Fri Oct 28, 2005 8:33 pm

Output in XSLT

Post by GameMusic »

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.

Code: Select all

<comments><![CDATA[<b>Comments</b>]]></comments>
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.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

Code: Select all

<comments><b><![CDATA[Comments]]></b></comments>
Post Reply