@Test public void testSel() throws Exception { String xpath = " List<Object> res = underTest.sel(xpath); Assert.assertNotNull(res); Assert.assertTrue(res.size() > 0); System.out.println(StringUtils.join(res, ",")); }
public List<Object> sel(String xpath) throws XpathSyntaxErrorException { List<Object> res = new LinkedList<Object>(); try { List<JXNode> jns = xpathEva.xpathParser(xpath,elements); for (JXNode j:jns){ if (j.isText()){ res.add(j.getTextVal()); }else { res.add(j.getElement()); } } } catch (Exception e){ String msg = "please check the xpath syntax"; if (e instanceof NoSuchAxisException||e instanceof NoSuchFunctionException){ msg = e.getMessage(); } throw new XpathSyntaxErrorException(msg); } return res; }
JXDocument { public List<Object> sel(String xpath) throws XpathSyntaxErrorException { List<Object> res = new LinkedList<Object>(); try { List<JXNode> jns = xpathEva.xpathParser(xpath,elements); for (JXNode j:jns){ if (j.isText()){ res.add(j.getTextVal()); }else { res.add(j.getElement()); } } } catch (Exception e){ String msg = "please check the xpath syntax"; if (e instanceof NoSuchAxisException||e instanceof NoSuchFunctionException){ msg = e.getMessage(); } throw new XpathSyntaxErrorException(msg); } return res; } }
JXDocument { public List<Object> sel(String xpath) throws XpathSyntaxErrorException { List<Object> res = new LinkedList<Object>(); try { List<JXNode> jns = xpathEva.xpathParser(xpath,elements); for (JXNode j:jns){ if (j.isText()){ res.add(j.getTextVal()); }else { res.add(j.getElement()); } } } catch (Exception e){ String msg = "please check the xpath syntax"; if (e instanceof NoSuchAxisException||e instanceof NoSuchFunctionException){ msg = e.getMessage(); } throw new XpathSyntaxErrorException(msg); } return res; } JXDocument(Document doc);  JXDocument(String html);  JXDocument(Elements els); }
JXDocument { public List<Object> sel(String xpath) throws XpathSyntaxErrorException { List<Object> res = new LinkedList<Object>(); try { List<JXNode> jns = xpathEva.xpathParser(xpath,elements); for (JXNode j:jns){ if (j.isText()){ res.add(j.getTextVal()); }else { res.add(j.getElement()); } } } catch (Exception e){ String msg = "please check the xpath syntax"; if (e instanceof NoSuchAxisException||e instanceof NoSuchFunctionException){ msg = e.getMessage(); } throw new XpathSyntaxErrorException(msg); } return res; } JXDocument(Document doc);  JXDocument(String html);  JXDocument(Elements els); List<Object> sel(String xpath); List<JXNode> selN(String xpath); Object selOne(String xpath); JXNode selNOne(String xpath); }
JXDocument { public List<Object> sel(String xpath) throws XpathSyntaxErrorException { List<Object> res = new LinkedList<Object>(); try { List<JXNode> jns = xpathEva.xpathParser(xpath,elements); for (JXNode j:jns){ if (j.isText()){ res.add(j.getTextVal()); }else { res.add(j.getElement()); } } } catch (Exception e){ String msg = "please check the xpath syntax"; if (e instanceof NoSuchAxisException||e instanceof NoSuchFunctionException){ msg = e.getMessage(); } throw new XpathSyntaxErrorException(msg); } return res; } JXDocument(Document doc);  JXDocument(String html);  JXDocument(Elements els); List<Object> sel(String xpath); List<JXNode> selN(String xpath); Object selOne(String xpath); JXNode selNOne(String xpath);  }