This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: xsl value-of


Jeni, thanks for your response...

I created a key in the top of the document

<xsl:key name="labels" match="xml/group/questionAnswered/label/text()"
use="concat(xml/group/@id, '_', xml/group/questionAnswered/label/@id)" />

but when trying to access the key I get nothing

<xsl:for-each select="z:row">
	<xsl:value-of select="key('labels', concat($groupId, '_', @id))" />
</xsl:for-each>

I tried by harcoding a key but nothing
<xsl:value-of select="key('labels', '02_05')" />

I think the keys are not being created...

any ideas?

thanks,
Matias

> -----Original Message-----
> From: owner-xsl-list@lists.mulberrytech.com
> [mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of Jeni Tennison
> Sent: martes, 02 de abril de 2002 11:07
> To: Matias Woloski
> Cc: xsl-list@lists.mulberrytech.com
> Subject: Re: [xsl] xsl value-of
>
>
> 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
>



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]