This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Dynamically selecting Attributes
- To: xsl-list at mulberrytech dot com
- Subject: RE: Dynamically selecting Attributes
- From: Oliver Becker <obecker at informatik dot hu-berlin dot de>
- Date: Fri, 13 Oct 2000 18:58:21 +0200 (MET DST)
- Reply-To: xsl-list at mulberrytech dot com
Hi Jeff,
> I'm trying to select an attribute dynamically based on another attributes'
> value. For example, given:
>
> <find target="name" />
>
> <record id="100" name="something" location="somewhere" />
>
> I would like to be able to return the value of the attribute in <record>
> that is named by the target attribute in the <find> element - the above
> example would return "something" (since <find>'s target attribute specifies
> "name" whose value in the <record> element is "something")
<xsl:variable name="target" select="find/@target" />
<xsl:value-of select="record/@*[name()=$target]" />
Cheers,
Oliver
/-------------------------------------------------------------------\
| ob|do Dipl.Inf. Oliver Becker |
| --+-- E-Mail: obecker@informatik.hu-berlin.de |
| op|qo WWW: http://www.informatik.hu-berlin.de/~obecker |
\-------------------------------------------------------------------/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list