In a given XML file, I\'m trying to search for the presence of a string using XPath in Java. However, even though the string is there, my output is always comi
XPath
XML/XPath are case-sensitive, your XPath should be
//article//body//section//region[contains(., 'Perfect')]
To make case-insensitive, use this
//article//body//section//region[ contains(translate(., 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'), 'perfect') ]