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>
If you use a
ancestor:: *,parent:: *andancestor-or-self: : *or../expression, the returned node set may contain duplicate nodes, especially in the following example:if you are executing the xpath:
//bbb/../ccc, you will get the duplicate nodes:or
//bbb/parent::*, you will get: