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

Re: Getting a predicate right

Subject: Re: Getting a predicate right
From: Joerg Heinicke <joerg.heinicke@xxxxxx>
Date: Tue, 30 Jul 2002 21:53:12 +0200
Re:  Getting a predicate right
Hello Matt,

with this description only the question of the context remains. If a <mesg> element is the context element, your XPath expression should be

<xsl:value-of select="/test/colors/desc[@id = current()/@grp]/@name"/>

I assume this is what you want.

"desc[@id = @grp]" can not work because both attributes refer to the <desc> element, which means the XPath is only true for a <desc> element, whose value of @id is the same like the value of @group.

Regards,

Joerg

Kuhns Matt wrote:
Sorry if I wasn't clear enough about what I wanted.
My XML Sheet looks like this:
<test>
<colors>
  <desc id="0" name="blue"/>
  <desc id="1" name="red"/>
  <desc id="2" name="white"/>
</colors>
<mesg grp="1">Hi how are you?</mesg>
<mesg grp="0">I am fine.</mesg>
<mesg grp="2">That is good.</mesg>
</test>
In my XSL I am going through the messages and trying
to match the attribute grp from mesg with the
attribute id from desc.
something like this:
//test/colors/desc[@grp]/@name
or
//test/colors/desc[@id = @grp]/@name
I hope this is clearer.
Thanks in advance.
Matt


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.