cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mac Schwarz <mcsch...@phil.uni-erlangen.de>
Subject setting a variable
Date Mon, 21 Aug 2000 15:05:23 GMT
Hi,

I'm trying to get a parameter value after a form submission to insert it
into a input field.

 <xsl:template match="gap">
    <xsl:variable name="guess"><request:get-parameter-values
name="{@id}"/></xsl:variable>
    <input type="text" size="{string-length(.)}" name="{@id}">
      <xsl:attribute name="value"><xsl:copy-of
select="$guess"/></xsl:attribute>
  </input>
  </xsl:template>


With the statement <request:get-parameter-values name="{@id}"/> I get
the value for the parameter identified with 
the id. Works fine so far. But to do anything useful except simply
displaying the value I have to bind it to a variable.

As far as I understand I define a variable $guess with the value
<request:get-parameter-values name="{@id}"/> with the statement in the
second line of code above.

Now <xsl:attribute name="value"><xsl:copy-of
select="$guess"/></xsl:attribute> should produce <xsl:attribute
name="value"><request:get-parameter-values
name="{@id}"/></xsl:attribute> after taglib execution and the resulting
java code should produce the parameter value I need.

But the value attribute of the resulting <input> tag is always empty: 
<input name="2" size="7" type="text" value>

What am I missing here?

	mac
-- 
Mac Schwarz / AERIA Projekt / Inst. f. Klassische Archaeologie
e-mail: mac@aeria.phil.uni-erlangen.de  / Tel.: 09131-85-24791
 FAU Erlangen-Nuernberg   /   Kochstr.4   /   91054 Erlangen
  <http://www.phil.uni-erlangen.de/~p1altar/aeriahome.html>

Mime
View raw message