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

Re: Pure XML & Javascript on client-side

Subject: Re: Pure XML & Javascript on client-side
From: Oleg Tkachenko <olegt@xxxxxxxxxxxxx>
Date: Mon, 03 Sep 2001 17:55:16 +0200
xml javascript
Thomas Morf wrote:
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">,
You probably mean <xsl:output method="xml"> ?

Example:

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

becomes

<input type="checkbox" name="foo"
onclick="function(getAttribute(&apos;name&apos;))">
Which xslt processor are you using ? This example evaluate to
<input type="checkbox" name="foo" onclick="function(getAttribute('name'))"/>
to me in msxml and saxon. XML output method must output well-formed xml and this combination of " and ' is well-formed. I think you meant more complex case where you have to intermingle " and ' in attribute's value, like onclick="func('data with "bla"')", which is not well-formed xml and have to be escaped. Or try a better solution - move all javascript code to one place (CDATA section) or to external js file to get free from well-formedness constraints in javascript code.



Similarly <script>var varname ="name" </script> is not possible.
But why ? It's well-formed xml. The only problem will arise if you try to use < and & in text, they must be escaped. Or use comments:

<script>
	<xsl:comment>
		<![CDATA[if  a <= "d" bla()]]>
	</xsl:comment>
</script>
--
Oleg Tkachenko
Multiconn International


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-2011 All Rights Reserved.