Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to check a node value against a set? #49

Closed
jinfengnarvar opened this issue May 21, 2020 · 2 comments
Closed

How to check a node value against a set? #49

jinfengnarvar opened this issue May 21, 2020 · 2 comments

Comments

@jinfengnarvar
Copy link
Contributor

Input xml:

<root>
  <a>
    <b>10</b>
    <c>ten</b>
  </a>
  <a>
    <b>20</b>
    <c>twenty</b>
  </a>
</root>

Desired XPATH:

/root/a[b = ('10', '15')]/c

But right now have to:

/root/a[b = '10' or b = '15']/c

Or am I missing something?

@jf-tech
Copy link
Contributor

jf-tech commented Nov 24, 2020

@zhengchun with matches added, this can be worked around like the following:

/root/a[matches(b, '^(10|15)$')]/c

You can close the issue if you agree with this assessment.

@zhengchun
Copy link
Contributor

#58

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants