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

[CHANGES] remove the duplicate element when the query node-set has duplicate element #94

Closed
zhengchun opened this issue Mar 29, 2024 · 0 comments

Comments

@zhengchun
Copy link
Contributor

If you use a ancestor:: *, parent:: * and ancestor-or-self: : * or ../ expression, the returned node set may contain duplicate nodes, especially in the following example:

<a>
  <bb>
    <bbb>1</bbb>
    <bbb>2</bbb>
    <ccc>3</ccc>
  </bb>
</a>

if you are executing the xpath: //bbb/../ccc, you will get the duplicate nodes:

<ccc>3</ccc>
<ccc>3</ccc>

or //bbb/parent::*, you will get:

<bb><bbb>1</bbb><bbb>2</bbb>...</bb>
<bb><bbb>1</bbb><bbb>2</bbb>...</bb>
zhengchun added a commit that referenced this issue Jun 23, 2024
…query` packages re-use the cached element in some cases. #94
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

1 participant