/** * Returns a list of XMap instances with all elements that match the * supplied XPath expression. Note that XPath result nodes that are not instance of * Element are ignored. Note also that returned XMaps contain original child elements of * the root element of this XMap so modifications made to child elements affect this XMap * instance as well. * * @param key an XPath expression. * @return an unmodifiable list of XMap instances. * @throws RuntimeException if the XPath expression isn't correct. */ public List<XMap> getAll(String key) { if (root == null) return new ArrayList<XMap>(0); try { List<Node> result = getXMLUtil().selectNodeSet(root, key); List<XMap> xMaps = new ArrayList<XMap>(result.size()); for (Node node : result) { if (node.getNodeType() == Node.ELEMENT_NODE) xMaps.add(new XMap(this.xmlUtil, (Element)node, false)); } return xMaps; } catch (Exception e) { throw new RuntimeException(e); } }
/** * Returns a list of XMap instances with all elements that match the * supplied XPath expression. Note that XPath result nodes that are not instance of * Element are ignored. Note also that returned XMaps contain original child elements of * the root element of this XMap so modifications made to child elements affect this XMap * instance as well. * * @param key an XPath expression. * @return an unmodifiable list of XMap instances. * @throws RuntimeException if the XPath expression isn't correct. */ public List<XMap> getAll(String key) { if (root == null) return new ArrayList<XMap>(0); try { List<Node> result = getXMLUtil().selectNodeSet(root, key); List<XMap> xMaps = new ArrayList<XMap>(result.size()); for (Node node : result) { if (node.getNodeType() == Node.ELEMENT_NODE) xMaps.add(new XMap(this.xmlUtil, (Element)node, false)); } return xMaps; } catch (Exception e) { throw new RuntimeException(e); } }
/** * Returns a list of XMap instances with all elements that match the * supplied XPath expression. Note that XPath result nodes that are not instance of * Element are ignored. Note also that returned XMaps contain original child elements of * the root element of this XMap so modifications made to child elements affect this XMap * instance as well. * * @param key an XPath expression. * @return an unmodifiable list of XMap instances. * @throws RuntimeException if the XPath expression isn't correct. */ public List<XMap> getAll(String key) { if (root == null) return new ArrayList<XMap>(0); try { List<Node> result = getXMLUtil().selectNodeSet(root, key); List<XMap> xMaps = new ArrayList<XMap>(result.size()); for (Node node : result) { if (node.getNodeType() == Node.ELEMENT_NODE) xMaps.add(new XMap(this.xmlUtil, (Element)node, false)); } return xMaps; } catch (Exception e) { throw new RuntimeException(e); } }
/** * Returns a list of XMap instances with all elements that match the * supplied XPath expression. Note that XPath result nodes that are not instance of * Element are ignored. Note also that returned XMaps contain original child elements of * the root element of this XMap so modifications made to child elements affect this XMap * instance as well. * * @param key an XPath expression. * @return an unmodifiable list of XMap instances. * @throws RuntimeException if the XPath expression isn't correct. */ public List<XMap> getAll(String key) { if (root == null) return new ArrayList<XMap>(0); try { List<Node> result = getXMLUtil().selectNodeSet(root, key); List<XMap> xMaps = new ArrayList<XMap>(result.size()); for (Node node : result) { if (node.getNodeType() == Node.ELEMENT_NODE) xMaps.add(new XMap(this.xmlUtil, (Element)node, false)); } return xMaps; } catch (Exception e) { throw new RuntimeException(e); } }