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

Pure XML & Javascript on client-side

Subject: Pure XML & Javascript on client-side
From: "Thomas Morf" <thmorf@xxxxxxxxxxx>
Date: Mon, 03 Sep 2001 15:06:09 +0200
thomas morf
Hi all

My web pages are "pure" xml (meaning no HTML or XHTML is used) which is
styled on the client using CSS. To add interactivity, I use Javascript. I transform a source XML file with XSLT before it's sent to the browser. The problem is that, when I use <xsl:output method="text/xml">, entities like ' and " are escaped (eg. &apos;) after I transformed the source XML file with XSLT
to the right format for the browser. But Javascript jokes at this point,
because it is exspecting the proper character '.


Example:

<input type="checkbox" name="foo" onclick="function(getAttribute('name'))">

becomes

<input type="checkbox" name="foo"
onclick="function(getAttribute(&apos;name&apos;))">

Similarly <script>var varname ="name" </script> is not possible.

I tried <xsl:output cdata-section-element="script"> without success. I get <script> <![CDATA[[var varname ="name"]]></script>, which is again not understood by the Javascript engine.

I'm aware of possible solutions like using either <?cocoon-format
type="text/xhtml"> or <xsl:output method="html"> which solve my
entitiy-escaping problem, but I have to use XHTML then.
I'm wondering if Mozilla and IE5+ can handle "pure" XML-, why should I use XHTML instead. Shouldn't it be possible to use a pure XML-Markup publishing model and still be able to use Javascript on the browser.


Did anyone solve this problem already?

Thanx in advance

Thomas Morf


My platform: JDK 1.3., Cocoon 1.8, Tomcat 3.1, WinNT 4.0


_________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


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.