|
Subject:
|
Help with complex xpath
|
|
Posted By:
|
craigahart
|
Post Date:
|
2/4/2004 9:56:23 AM
|
I'm new to XSLT, and although I think I've mastered the basics I am completely stuck with the following problem. Help would be much appreciated!
Consider the following XML:
<Document> <Class name="A"> <Attr name="x" type="String"/> <Attr name="y" type="Integer"/> <Attr name="z" type="Double"/> </Class> <Class name="B"> <Attr name="p" type="String"/> <Attr name="q" type="String"/> </Class> <Object type="A"> <AttrValue value="string1"/> <AttrValue value="10"/> <AttrValue value="3.14"/> </Object> <Object type="A"> <AttrValue value="string2"/> <AttrValue value="20"/> <AttrValue value="2.71"/> </Object> <Object type="B"> <AttrValue value="string3"/> <AttrValue value="string4"/> </Object> </Document>
The rule is that Class/Attr[x] is associated with Object/AttrValue[x].
What is the xpath expression that would give me a node list of all AttrValue/@value whose corresponding Attr/@type = 'String'. Ie. the results for the above example would be string1 | string2 | string3 | string4
Is this possible? Thanks for your time.
|
|
Reply By:
|
craigahart
|
Reply Date:
|
2/25/2004 3:33:25 AM
|
This not possible then?
I've achieved the desired result using a template, but if doesn't feel right.
Cheers.
|