void lookup(String text) { NodeList nl = DOMInfoExtractor.locateNodes(document, ".//text()[contains(.,'" + text + "')]"); System.out.println("find " + nl.getLength() + " items"); FoundItem[] fis = new FoundItem[nl.getLength()]; for (int i = 0; i < nl.getLength(); i++) { fis[i] = getFoundItem(nl.item(i), text); } foundList.setListData(fis); }
void lookupByXPath(String xpath) { NodeList nl = DOMInfoExtractor.locateNodes(document, xpath); System.out.println("lookupByXPath: " + xpath); if (nl == null) { JOptionPane.showMessageDialog(this, "error xpath: " + xpath); } System.out.println("find " + nl.getLength() + " items"); FoundItem[] fis = new FoundItem[nl.getLength()]; for (int i = 0; i < nl.getLength(); i++) { fis[i] = getFoundItem(nl.item(i), null); } foundList.setListData(fis); }