This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: xsl value-of
- From: Jeni Tennison <jeni at jenitennison dot com>
- To: "Matias Woloski" <woloski at sion dot com>
- Cc: xsl-list at lists dot mulberrytech dot com
- Date: Tue, 2 Apr 2002 15:07:00 +0100
- Subject: Re: [xsl] xsl value-of
- Organization: Jeni Tennison Consulting Ltd
- References: <BBEJKGIELKMFIMGJKDMNMEMHDLAA.woloski@sion.com>
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hi Matias,
> So how can i reach the text attribute of the label element according
> the id of the label and the id of the z:row?
The easiest thing to do is to create a key that indexes the label
elements by their id:
<xsl:key name="labels" match="label" use="@id" />
You can then, for example, get the label element whose id is 03 using:
key('labels', '03')
So if the current node is a z:row element, you can get the value of
the label that has the same id as the id of the z:row element using:
<xsl:value-of select="key('labels', @id)" />
(Note that you were after the "string value" of the label, or its text
node child, not the "text attribute" -- the label elements in your
example didn't have any attributes called 'text'.)
Cheers,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list