[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Javascript looping expression in stylesheet

Subject: RE: Javascript looping expression in stylesheet
From: "Stuart Celarier" <stuart@xxxxxxxxxxx>
Date: Wed, 8 May 2002 12:25:52 -0700
javascript inside stylesheet
XSLT is XML, and all XML needs to escape certain characters. According
to the XML specification
(http://www.w3.org/TR/2000/REC-xml-20001006#syntax), section 2.6,
Character Data and Markup:

The ampersand character (&) and the left angle bracket (<) may appear in
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 use
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

-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Zoe Peng
Sent: Wednesday, May 08, 2002 11:22
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject:  Javascript looping expression in stylesheet

Hi, 
I am going to include a javascript inside the stylesheet. It works in 
some javascripts. But, it fails when I try to use for function. 
some charactures can't escape such as for (var i = 1; i <= nom; i++) {}
It fails in = sign or & sign. any ideas? Thanks. 

--Zoe




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.