Given the following XML, how do I select the uid
element whose preceding-siblings are comments with normalized text value equal to "VID_1128" or "Some Title"? The problem here is that "Some Title" precedes two <uid>
elements, so I only want to select the uid
element whose value is 3333
. Is this possible to do with XPath 1.0, and if so how?
<?xml version="1.0"?>
<uids>
<!-- Some Unique Text -->
<!-- VID_2564 -->
<uid>1111</uid>
<!-- Some Title -->
<!-- VID_8374 -->
<uid>2222</uid>
<!-- Some Title -->
<!-- VID_1128 -->
<uid>3333</uid>
<!-- A Different Title -->
<!-- VID_9581 -->
<uid>4444</uid>
</uids>