XML::   Help on Xpath expression

B_Pati
B_Pati used Ask the Experts™
on
Hi all,

      I have an xml as below.

<Issue
<IssueIdentifiers
<IssueIdentifier Source="ID">123456</IssueIdentifier>
<IssueIdentifier  Source="SEDOL">2408259</IssueIdentifier>
<IssueIdentifier  Source="BBUNIQUE">EQ0094817300001000</IssueIdentifier>
<IssueIdentifier  Source="BBCMPSEC">948173-1000</IssueIdentifier>
<IssueIdentifier  Source="BBGLOBAL">BBG000BKQS48</IssueIdentifier>
<IssueIdentifier  Source="BBCPTICK">4792423Q US</IssueIdentifier>
<IssueIdentifier  Source="WPK">Prop</IssueIdentifier>
<IssueIdentifier  Source="DST_ID"></IssueIdentifier> </IssueIdentifiers
</Issue>

From the above xml   i need to write an xpath expression   in such a way that

if the Attribute Source="DST_ID" has a null value  or attribute source ="WPK"  has a value of "Prop"  then select  attribute  source = "ID"    value  which would be   123456 as per the example provided..
Thanks for the Help in Advance.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Glanced up at my screen and thought I had coded the Matrix...  Turns out, I just fell asleep on the keyboard.
Most Valuable Expert 2011
Top Expert 2015
Commented:
Try this:
/Issue/IssueIdentifiers[IssueIdentifier[@Source="DST_ID"]="" or IssueIdentifier[@Source="WPK"]="Prop"]/IssueIdentifier[@Source="ID"]

Open in new window

Author

Commented:
Yes  it was help ful

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial