I have a java app in which I use javax.xml.xpath to get references to nodes in XML documents. I'm looking for nodes that have attributes with specific names. I dynamically add the attribute name using inputMsgName as in the following:
Originally the attribute names in my XML files were all initial cap, but now some files also have attribute names with iniital lower case.
Is there a way to indicate that I want to ignore case in the supplied inputMsgName?
I realize that I can rewrite my app to have an additional call with inputMsgName converted to initial lower case, but I would rather go with a simpler solution if it is possible.
Thanks.
Code:
String expression="/xs:schema/xs:complexType[@name='" + inputMsgName + "']/xs:complexContent/xs:extension/xs:sequence/xs:element";
XPathExpression expr = xpath.compile(expression);
Object result = expr.evaluate(doc,XPathConstants.NODESET);
Originally the attribute names in my XML files were all initial cap, but now some files also have attribute names with iniital lower case.
Is there a way to indicate that I want to ignore case in the supplied inputMsgName?
I realize that I can rewrite my app to have an additional call with inputMsgName converted to initial lower case, but I would rather go with a simpler solution if it is possible.
Thanks.