Page 1 of 1

Re: XPath Query in file compare

Posted: Tue Dec 07, 2021 7:54 pm
by teo
Hello,

The expression you used excludes from comparison all the attributes called "name", simply not taking into account their values.
But it seems that you intend to exclude only certain elements, those for which the "name" attribute has a certain value.

You should try then an XPath of the form: //queryExpression[@name="ATTR_VALUE_USED_FOR_EXCLUSION"]
ATTR_VALUE_USED_FOR_EXCLUSION could also be expressed using a RegExp if you use matches() function, available with XPath 2.0.

An absolute random example: queryExpression[matches(@name,'q[a-z]+t')]
That RegExp actually means a pattern for the value of the "name" attribute: it starts with the letter 'q', ends with the letter 't', and between them there can be any other letters.

I hope I understood your use case well and you'll find my explanations useful.

Regards,
Teo