|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] xsl:stylesheet : scripts or PI embedded in attributes
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
|
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
|

Cart








