For me it was a big difference when I faced this scenario (here my story:)
<?xml version="1.0" encoding="UTF-8"?>
<sentence id="S1.6">When U937 cells were infected with HIV-1,
<xcope id="X1.6.3">
<cue ref="X1.6.3" type="negation">no</cue>
induction of NF-KB factor was detected
</xcope>
, whereas high level of progeny virions was produced,
<xcope id="X1.6.2">
<cue ref="X1.6.2" type="speculation">suggesting</cue> that this factor was
<xcope id="X1.6.1">
<cue ref="X1.6.1" type="negation">not</cue> required for viral replication
</xcope>
</xcope>.
</sentence>
I needed to extract text between tags and aggregate (by concat) the text including in innner tags.
/node()
did the job, while /text()
made half job
/text()
only returned text not included in inner tags, because inner tags are not "text nodes". You may think, "just extract text included in the inner tags in an additional xpath", however, it becomes challenging to sort the text in this original order because you dont know where to place the aggregated text from the inner tags!because you dont know where to place the aggregated text from the inner nodes.
Finally, /node()
did exactly what I wanted, because it gets the text from inner tags too.