Xpath expression for getting substring of a node without using substring-before or substring

Viewed 57
<tag1>
    <ResId Type="22" ID="MASTN_NHR" />
</tag1>

I want to get the string MASTN from the above xml(Java code). Do we have any option without using substring-before or substring?

1 Answers

this could work (XPath 2.0):

tokenize(@ID,'_')[1]
Related