You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Xavier Brouckaert <xb...@info.fundp.ac.be> on 2001/06/27 16:10:42 UTC

XSP: Inserting the value of a variable in an attribute of a HTML Tag within XSL

Please excuse me if it's not the right place to ask this.

All I want to do is to dynamically generate an A HREF tag in a XSL file with the value of a Java variable.

I have tried this in an XSL file :

	<xsp:logic>
	<![CDATA[
		String Ahref(String Href,String Text) {
			return "<A HREF='"+Href+"'>"+Text+"</A>";
		}
	]]>
	</xsp:logic>

	...

	<xsp:expr>
		Ahref(response.encodeURL("Historique.xml?Skin=New"),"Historique avec New Skin")
	</xsp:expr>


, but I see the tags in raw in the browser: "<A HREF='Historique.xml?Skin=New'>Historique avec New Skin</A>".

How can I achieve this ?

I use Cocoon 1.8, Tomcat 3.2.2, JDK 1.3.1, Redhat Linux 7.1

Xavier Brouckaert


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>