[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

xsl:stylesheet : scripts or PI embedded in attributes

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
embed scripts
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 &lt; b) foo()</script>
<a href="foo.html">
	<xsl:attribute name="onClick">
		<script>if (a &lt; b) foo()</script>
	</xsl:attribute>
</a>

gives 

<script>if (a < b) foo()</script>
<a href="foo.html" onClick="if (a &lt; 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 &lt; b) foo();
?</xsl:processing-instruction>
<a href="foo.html">
	<xsl:attribute name="onClick">
		<xsl:processing-instruction name="php">if (a &lt; 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">&lt;</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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.