/** * Gets the immediate children of each element in the set of matched elements. */ public Jerry children() { List<Node> result = new NodeList(nodes.length); if (nodes.length > 0) { for (Node node : nodes) { Node[] children = node.getChildElements(); Collections.addAll(result, children); } } return new Jerry(this, result); }
/** * Gets the siblings of each element in the set of matched elements. */ public Jerry siblings() { List<Node> result = new NodeList(nodes.length); if (nodes.length > 0) { for (Node node : nodes) { Node[] allElements = node.getParentNode().getChildElements(); for (Node sibling : allElements) { if (sibling != node) { result.add(sibling); } } } } return new Jerry(this, result); }
public T extractData(Source source) throws IOException { Node rootNode = ((DOMSource)source) NodeList nodes = rootNode.getChildElements(); for (int i = 0; i < nodes.getLength(); i++) { String nodeText = nodes.item(i).getTextContent(); /* Remainder of loop and method elided */ } }
public T extractData(Source source) throws IOException { Node rootNode = ((DOMSource)source) NodeList nodes = rootNode.getChildElements(); for (int i = 0; i < nodes.getLength(); i++) { TextImpl nodeTextImpl = (TextImpl) nodes.item(i).getFirstChild(); String nodeText = nodeTextImpl.getData(); /* Remainder of loop and method elided */ } }
/** * Gets the immediate children of each element in the set of matched elements. */ public Jerry children() { List<Node> result = new NodeList(nodes.length); for (Node node : nodes) { Node[] children = node.getChildElements(); Collections.addAll(result, children); } return new Jerry(this, result); }
/** * Gets the immediate children of each element in the set of matched elements. */ public Jerry children() { List<Node> result = new NodeList(nodes.length); for (Node node : nodes) { Node[] children = node.getChildElements(); for (Node child : children) { result.add(child); } } return new Jerry(this, result); }
/** * Gets the immediate children of each element in the set of matched elements. */ public Jerry children() { List<Node> result = new NodeList(nodes.length); if (nodes.length > 0) { for (Node node : nodes) { Node[] children = node.getChildElements(); Collections.addAll(result, children); } } return new Jerry(this, result); }
/** * Gets the siblings of each element in the set of matched elements. */ public Jerry siblings() { List<Node> result = new NodeList(nodes.length); for (Node node : nodes) { Node[] allElements = node.getParentNode().getChildElements(); for (Node sibling : allElements) { if (sibling != node) { result.add(sibling); } } } return new Jerry(this, result); }
/** * Gets the siblings of each element in the set of matched elements. */ public Jerry siblings() { List<Node> result = new NodeList(nodes.length); for (Node node : nodes) { Node[] allElements = node.getParentNode().getChildElements(); for (Node sibling : allElements) { if (sibling != node) { result.add(sibling); } } } return new Jerry(this, result); }
/** * Gets the siblings of each element in the set of matched elements. */ public Jerry siblings() { List<Node> result = new NodeList(nodes.length); if (nodes.length > 0) { for (Node node : nodes) { Node[] allElements = node.getParentNode().getChildElements(); for (Node sibling : allElements) { if (sibling != node) { result.add(sibling); } } } } return new Jerry(this, result); }