Parameswar
Parameswar

Reputation: 2069

Conditional xpath

I have an xml of this format: XML

What do we do to get the following condition : select Batch value="xpkk" if manufacture date is wednesday, and select Batch value=abcd when the manufacture date is monday ?

Upvotes: 0

Views: 84

Answers (1)

hr_117
hr_117

Reputation: 9627

I don't know what "manufacture date is wednesday" should exactly mean. But you may try:

//material[book/manufacture/@date = 'wednesday']/Batch

If your manufacture where you are looking for is in a variable lets say day you may try:

//material[book/manufacture/@date = $day]/Batch

Upvotes: 1

Related Questions