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

Escaping apostrophes for use in javascript, etc. - how

Subject: Escaping apostrophes for use in javascript, etc. - how totrouble shoot template results?
From: "Kathy Burke" <Kathy_Burke@xxxxxxxxx>
Date: Thu, 9 Oct 2003 08:34:31 -0400
escaping in javascript
This is one of those questions where I don't know at this point what is xsl
related and what is not, but after two days of trying, I'm thought I'd ask
here.

I'm using a stylesheet whose output includes some javascript (typical stuff,
validation, submit, etc.) run exclusively in IE6  using msxml4. One of the
functions includes a parameter whose text can contain apostophes.

function Anomaly(typeIn,idIn,textIn)
newWindow =
window.open(('Anomaly.aspx?type='+typeIn+'&id='+idIn+'&text='+textIn),
'Anomaly', 'width=650,height=700');

This passes certain text nodes as parameters, which then get included in the
querystring to the next form.

Trying to solve this, I included a template written by Jeni Tennison (from
an online post) to escape apostrophes. In the variable name="apos" the
select='"&apos;"'  -- I don't understand how/if this is working. Does xsl
look for the actual ' character?  And how would one tell if it's working...I
know I wouldn't see a backslash appear with the apostrophe in the html
output transformation, but how do I check if this is working? I'm still
getting javascript errors which I'm sure is tied to the apostrope (and/or
use of backslash or forward slash) in my text elements being passed to the
querystring.

Sorry if this is OT, but hoping someone can point me in the right direction,
even just how to troubleshoot further. Of course, the error messages don't
seem to be pointing to the actual lines causing the trouble. I'm using both
Xslerlator and IE6.

Thanks.  Kathy




 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.