Quelle bibliothèque me permettrait d'évaluer xpath sur une chaîne html?Java: comment analyser une chaîne html pour l'outil XML consommer?
J'ai essayé d'utiliser le package javax mais cela semble à l'échec:
String docroot = "<div><i>items <b>sold</b></i></div>";
XPath xxpath = XPathFactory.newInstance().newXPath();
InputSource docroot = new InputSource(new StringReader(subelements));
String result = (String) xxpath.evaluate("//b", docroot, XPathConstants.STRING);
S'il vous plaît se rappeler la prochaine fois pour développer « semble échouer » substantionally. –