Forum Moderators: open

Message Too Old, No Replies

XSL HTML Generation

How do I hide some HTML code from the generator

         

Jack_Hughes

7:12 pm on Aug 2, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I am currently working on a XSL transformation of a XML file to HTML. Unfortunately, my html is php code and as such contains all sorts of things like includes and such that my XSL processor finds a little puzzling.

Is there a way I can hide some of the html from the processor so that it just places it into the generated html file without looking at it too much?

choster

1:36 pm on Aug 3, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can hide code inside escaped text blocks; your XSLT processor will ignore anything inside a CDATA block and pass it through:

<![CDATA[
some text
a few & reserved < characters
<some non-compliant markup>
the text string <xsl:value-of select="$var">, not its value
]]>

Also read up on the cdata-section-elements attribute of <xsl:output>.