cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marco Rolappe" <>
Subject AW: Generating dynamic attributes in xsp
Date Sun, 02 Mar 2003 13:35:39 GMT
hi amelie (nice name ;-),

instead of passing the 'name' parameter as an attribute of <mytag:user> you
could use an element with the same name. the logicsheet-util logicsheet that
comes with cocoon has templates that you can call to get a parameter. it
checks for an attribute and an element with the name you specify.

example markup:

	<name><xsp-request:get-parameter name="user"/></name>

and your modified logicsheet would look something like this:

<xsl:include href="logicsheet-util.xsl"/>

<xsl:param name="namespace-uri">http://your/namespace/uri</xsl:param> <!--
you know -->

<xsl:template match="mytag:user[@name or name]">
	<xsl:variable name="name">
		<xsl:call-template name="get-string-parameter">
			<xsl:with-param name="name">name</xsl:with-param>
			<xsl:with-param name="required">true</xsl:with-param>


and in your template you now accees the parameter via the variable.

> -----Ursprüngliche Nachricht-----
> Von:
> []Im
> Auftrag von Amelie Cordier
> Gesendet: Sonntag, 2. März 2003 14:27
> An:
> Betreff: Generating dynamic attributes in xsp
> Hello,
> I have an xsp page and a logicsheet where I have defined my own tags.
> In my logicsheet I use thinks like that : <xsl:template
> match="mytag:user[@name]"> in order to perform specifics resquests on a
> database.
> This work perfectly if I use a tag like <mytag:user name="foo"/>
> in the xsp.
> But my problem is that I want the attribute "name" to be dynamically
> generated  by using resquest-parameter.
> I mean, in my xsp page, I don't want to write "foo" but something like
> <xsp-request:get-parameter name="user"/> and I really don't know how to do
> it.
> Thanks for help
> Amelie.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message