1

I am applying a metadata filter to an existing XML document that looks like this:

//description[text()='Desc'] and //keyword[@ddms:value='Adv1']

My question is, how would I filter multiple keywords? Would it be as simple as:

//description[text()='Desc'] and //keyword[@ddms:value='Adv1', 'Adv2', 'Adv3', 'etc']

Thanks in Advance.

1 Answer 1

1

It depends on what version of XPath.

XPath 2.0 can handle sequences:

//keyword[@ddms:value=('Adv1', 'Adv2', 'Adv3', 'etc')]

XPath 1.0 is more verbose:

//keyword[@ddms:value='Adv1' or @ddms:value='Adv2' or @ddms:value='Adv3']
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.