|
Subject: RE: [xsl] referencing a param inside a template From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx> Date: Tue, 21 May 2002 08:52:55 +0100 |
Look up "attribute value templates".
value="{$ID}"
Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx
> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of
> Jeff Barrett
> Sent: 20 May 2002 22:52
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] referencing a param inside a template
>
>
> I am trying to reference information passed into an XSL
> stylesheet (via java's transformer.setParameter() method) in
> the output of a template, but I'm running into some trouble.
> My output is html and the parameter I'm passing in needs to
> be an attribute value in the html. I've tried this two ways.
> First I tried putting the parameter directly into the output
> HTML like so:
>
>
> <xsl:template match="program">
> <input type='hidden' name='unique-id'
> value='$ID'></input>
> </xsl:template>
>
> This results in the $ID NOT being evaluated as a paramter or
> variable, but the plain string "$ID".
>
> My next attempt was to use the xsl:value-of tag:
>
> <xsl:template match="program">
> <input type='hidden' name='unique-id'
> value='<xsl:value-of select="$ID"'></input>
> </xsl:template>
>
> But that won't work because according to the error I get:
> attribute values may not contain '<'.
>
> Am I missing something? Are params/variables only to be used
> in XPath expressions?
>
> thanks,
> +jeff
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| RE: [xsl] referencing a param insid, Stuart Celarier | Thread | RE: [xsl] referencing a param insid, sara . mitchell |
| RE: [xsl] new member, Michael Kay | Date | RE: [xsl] NullPointerException, Michael Kay |
| Month |