[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Pure XML & Javascript on client-side
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. ') 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('name'))"> 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
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|