Subject: xsl:stylesheet : scripts or PI embedded in attributes From: Eric van der Vlist <vdv@xxxxxxxxxxxx> Date: Fri, 03 Sep 1999 13:05:31 +0200 |
Hi, I am using XT (Version 19990822) and I am struggling to embed scripts or PI within attributes (my goal is to check the browser release and other parameters such as cookies before calling javascript functions). The script elements is working according to the W3C Working Draft 13 August 1999, except when you try to embed them in attributes (where they are silently ignored and their content processed as normal text : <script>if (a < b) foo()</script> <a href="foo.html"> <xsl:attribute name="onClick"> <script>if (a < b) foo()</script> </xsl:attribute> </a> gives <script>if (a < b) foo()</script> <a href="foo.html" onClick="if (a < b) foo()"></a> and so does <script><![CDATA[if (a < b) foo()]]></script> <a href="foo.html"> <xsl:attribute name="onClick"> <script><![CDATA[if (a < b) foo()]]></script> </xsl:attribute> </a> PI instructions are just ignored while embedded in attributes : <xsl:processing-instruction name="php">if (a < b) foo(); ?</xsl:processing-instruction> <a href="foo.html"> <xsl:attribute name="onClick"> <xsl:processing-instruction name="php">if (a < b) foo(); ?</xsl:processing-instruction> </xsl:attribute> </a> gives <?php if (a < b) foo(); ?> <a href="foo.html" onClick=""></a> And, at last, text disable is forbidden within attributes : <a href="foo.html"> <xsl:attribute name="onClick"> <xsl:text disable-output-escaping="yes"><</xsl:text> </xsl:attribute> </a> gives the error illegal use of disable-output-escaping='yes' Is there any way(s) to embed scripts or PI instructions in attributes ? Thanks Eric -- ------------------------------------------------------------------------ Eric van der Vlist Dyomedea http://www.dyomedea.com http://www.ducotede.com ------------------------------------------------------------------------ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: XLS wanted...., Vun Kannon, David | Thread | Re: xsl:stylesheet : scripts or PI , David Carlisle |
XLS wanted...., Cristobal Galiano Fe | Date | Re: xsl:stylesheet : scripts or PI , David Carlisle |
Month |