PDA

Click to See Complete Forum and Search --> : [Resolved]Xpath


Martin Wilson
Mar 15th, 2004, 05:48 PM
hey, sorry for the non-descriptive subject, but this really can't be described in a few words or i'd have used google :-)
ok...given this XML as a simplified example:<a>
<b>x</b>
<c>1</c>
</a>
<a>
<b>y</b>
<c>2</c>
</a>
<a>
<b>z</b>
<c>3</c>
</a>

<d>
<b>y</b>
</d>

For each d element, I want the value of c in the a element with a matching value of b.

Got that?

tia
-Martin

Martin Wilson
Mar 15th, 2004, 06:06 PM
Fixed it my self, for those that want to know...

add something like:
<xsl:key name='a-search' match='a' use='b' />
before the <xsl:stylesheet> element.

then the XPath is:

key('a-search', b)/c


hope that helps someone

-Martin