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 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 Javascript.

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 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


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to