Skip to content

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

Closed

Description

@zhengchun

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>

Activity

  1. added a commit that references this issue on Jun 23, 2024
  2. added a commit that references this issue on Oct 1, 2024
    3667596
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions