XPath doesn't stop with the first match; instead, it will return all matching elements.
You need to figure out how to be more specific in what you want. Maybe you just want the first INSTANCE
?
//INSTANCE[0]/ATTRIBUTE[@name='Description' and @type='STRING']
Or maybe the description of a specific INSTANCE
?
//INSTANCE[@id='obj.25615']/ATTRIBUTE[@name='Description' and @type='STRING']
But the ID is probably pretty random, so you'll want to use the name of the instance instead:
//INSTANCE[@name='Business Opportunities census']/ATTRIBUTE[@name='Description' and @type='STRING']
Note that //
will recursively search for a match; if you have several MODEL
instances with Business Opportunities census
, then you'll need to figure out a way to distinguish them as well.