[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: xsl value-of

Subject: Re: xsl value-of
From: "Joerg Heinicke" <joerg.heinicke@xxxxxx>
Date: Tue, 2 Apr 2002 19:57:19 +0200
xsl value of select key
> <xsl:key name="labels" match="xml/group/questionAnswered/label/text()"
> use="concat(xml/group/@id, '_', xml/group/questionAnswered/label/@id)" />

You have to match on label and not its text-node. From this node you can go
back to the group-element, choose its @id and the @id of the current
label-element:

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

The more specific XPATH "xml/group/questionAnswered/label" you only need
when there are more <label>s in your file, you want to exclude from the
<xsl:key>.

Hope this helps,

Joerg

----- Original Message -----
From: "Matias Woloski" <woloski@xxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Tuesday, April 02, 2002 7:21 PM
Subject: 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@xxxxxxxxxxxxxxxxxxxxxx
> > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Jeni Tennison
> > Sent: martes, 02 de abril de 2002 11:07
> > To: Matias Woloski
> > Cc: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> > Subject: Re:  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
>


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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.