[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Un-cdata-section-elements
Hi, On 3/22/06, David Carlisle <davidc@xxxxxxxxx> wrote: > In theory you should never need to do this. Yup, I know all about that theory, but reality is a bit more biting. :) ... > > but the JavaScript > > engines complain (it doesn't understand CDATA, of course) > If the page is handled by a conforming XHTML system all aspects of the > XML markup will be resolved before javascript sees the file. The problem isn't the validity of the XML, but the validity of the JavaScript embedded within it. Best practice has it that the opening and ending parts of an XML CDATA section should be preceded with single-line comments ('//'), but through XSLT I have no control over how the processor outputs those CDATA sections. In other words, I can't do ; <script type="javascript"> // <![CDATA[ <----------- It's this first '//' what I'm after javascript here ... // ]]> </script> if I rely on the XSLT processor handle matching <script>'s. Right? I'm pretty sure the answer is that the best practice I'm wanting isn't possible through XSLT 1.0. Almost all my JavaScript code is tucked away nicely in external files, but at two points in my XHTML page I need to call a function. I could circumvent all of this through writing an event manager that triggers given elements after page load, for example, but it seemed like such a huge effort for such a miniscule task. So, basically I can't override the DTD's rules for the <script> element in any way, without relying on buggy / non-conforming XSLT processors? Alex -- "Ultimately, all things are known because you want to believe you know." - Frank Herbert __ http://shelter.nu/ __________________________________________________
|
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
|