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

Javascript variables and xsl elements containing special cha

Subject: Javascript variables and xsl elements containing special characters
From: mvictor@xxxxxxxxxx
Date: Fri, 1 Dec 2000 17:16:44 -0500
javascript variable containing
Hello,
     I need to pass the value of a XSL element into a JavaScript variable.
I've searched for information, and this is what I've come up with.

given:

<desc>some text</desc>

I can do the following:

JSDesc = '<xsl:value-of select="desc"/>'
printDescription(JSDesc)

which results in:
JSDesc='some text'

This works fine for me, unless the element contains an apostrophe.  i.e.:
<desc>Mike's record</desc>


Using the same assignment method results in the following:

JSDesc='Mike's record'

which is invalid.

 I've tried various implementations of CDATA, but have not had any luck in
getting it to work.  In this case, CDATA seems to work fine for the other
special characters, but not the apostrophe.   How do I assign the value of
an XML element , which contains an apostrophe, to a JavaScript Variable?

Thanks



 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.