How to read XML using XPath in Java
You need something along the lines of this: DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document doc = builder.parse(<uri_as_string>); XPathFactory xPathfactory = XPathFactory.newInstance(); XPath xpath = xPathfactory.newXPath(); XPathExpression expr = xpath.compile(<xpath_expression>); Then you call expr.evaluate() passing in the document defined in that code and the return type you are expecting, and cast the result … Read more