/descendant::dupe_node[1]
//dupe_node[1]
is generally wrong, although it produces an identical result in this particular case. See docs:
The location path //para[1] does not mean the same as the location path /descendant::para[1]. The latter selects the first descendant para element; the former selects all descendant para elements that are the first para children of their parents.
Given the following XML:
<foo>
<bar/>
<foo>
<bar/>
</foo>
</foo>
//bar[1]
will produce two nodes, because both bars are first children of their respective parents.
/descendant::bar[1]
will give only one node, which is the first of all the bars in the document.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…