This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: XSLT/XPath help to resolve definition references in a WSDL XML fi le
- From: TSchutzerWeissmann at uk dot imshealth dot com
- To: xsl-list at lists dot mulberrytech dot com
- Date: Wed, 4 Sep 2002 15:40:50 +0100
- Subject: RE: [xsl] XSLT/XPath help to resolve definition references in a WSDL XML fi le
- Reply-to: xsl-list at lists dot mulberrytech dot com
hi Thomas,
> I need some help on pure XSLT/XPath syntax/capabilities.
> Let's say that I have an XML document looking like that:
>
> <root>
> <A name="a1"><B .../></A>
> <A name="a2"><B .../></A>
> <A name="a3"><B .../></A>
> <C aRef="ns1:a1"/>
> <C aRef="ns2:a2"/>
> </root>
>
> I want to be able to select all the B element which are under
> the A elements
> referenced by the C element (the A elements for which a
> C/@aRef attribute
> value, minus the prefix, is equal to the A/@name attribute).
>
Use a key on the C's:
<xsl:key name="CRefs" match="C" use="@aRef"/>
Then this as your path in <root> context.
select="A[@name = key('CRefs',substring-after(@aRef,':'))]/B"
Don't know if it works...
Tom
---
"At the first performance I led the attack in person 33 times.
We had three acclamations, four hilarities, two thrilling movements,
four renewals of applause and two indefinite explosions."
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list