I have following XML:
<Library>
<Item>
<Field Name="Name">smooth</Field>
<Field Name="File Type">mid</Field>
<Field Name="File Size">60026</Field>
</Item>
<Item>
<Field Name="Name">mid</Field>
<Field Name="File Type">mp3</Field>
<Field Name="File Size">4584972</Field>
</Item>
</Library>
I'd like to get all item names of items of the file type "mid". My XPATH query looks as
/Library/Item/Field
[
@Name="Name" and
(../Field[@Name="File Type" and ../Field[.="mid"]])
]
But unfortunately both items are returned from that query.
smooth
mid
Seems that the last condition is not checked against fields with the attribute "File Type" only, but all fields. Which results in a return of the name "mid", even if this item is of file type "mp3".
How can I restrict the comparison with "mid" to the value of the field with the attribute Name="File Type"?
Can anybody suggest me an XPATH syntax which works as expected?