xml - Do XPath on a Node with Java -


I have some nodes and I want to do XPath in this way:

  XPath Xpath = XPathFactory.newInstance (). NewXPath (); XPathExpression expr = xpath.compile ("// name"); Object result = expr.evaluate (SOMETHING_ELSE, XPathConstants.NODE);  

How do I change some nodes in SOMETHING_ELSE and can I XPath?

what is wrong in object result = expr.evaluate (someNode, XPathConstants.NODE) is; ? XPathExpression takes an object as the first parameter, and you can pass any reference to a node, element, or attribute of your XML document.


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -