RE: [xsl] Javascript looping expression in stylesheet

Subject: RE: [xsl] Javascript looping expression in stylesheet
From: "Zoe Peng" <zoe@xxxxxxxxxxxx>
Date: Wed, 8 May 2002 18:18:26 -0400
Thank you guys. 
It ends up to use <![CDATA[]]> to make javascript work. 
very strange...It works in CSS, too. 

// those two are produced the same results. =)
<!-- load the css file -->
<xsl:processing-instruction name="xml-stylesheet">
<xsl:text>href="menu.css" type="text/css"</xsl:text>
<!-- load the css file -->
<style type="text/css">


> XSLT is XML, and all XML needs to escape certain characters. According
> to the XML specification
> (, section 2.6,
> Character Data and Markup:
> The ampersand character (&) and the left angle bracket (<) may appear 
> their literal form only when used as markup delimiters, or within a
> comment, a processing instruction, or a CDATA section. If they are
> needed elsewhere, they must be escaped using either numeric character
> references or the strings "& amp ;" and "& lt ;" respectively.
> [NOTE: omit the space characters in the quotes - I've added those so
> that some email programs don't thing they are HTML and render them as
> characters!]
> The reason for this is that ampersand and left angle bracket have
> special meaning to XML: they indicate escaped characters and the start
> of XML tags, respectively. Know your XML.
> So if you've only got a few occurrences of these characters, you can 
> the & amp ; and & lt ; symbols, or you can place the contents of the
> text block in a CDATA section, such as this:
> <xsl:text>
>   <![CDATA[My funky text that uses < and & all the time...]]>
> </xsl:text>
> Cheers,
> Stuart

 XSL-List info and archive:

Current Thread