public XOMNodeWrapper getFirstChild() { if (node.getChildCount() > 0) { for (int i = 0; i < node.getChildCount(); i++) { Node n = node.getChild(i); if (!(n instanceof DocType)) { return makeWrapper(n, docWrapper, this, 0); } } } return null; }
writeEscaped(node.getChild(0).getValue()); // string value of atomic value mayBreakLine = false; isPreviousAtomic = true;
public XOMNodeWrapper getFirstChild() { if (node.getChildCount() > 0) { for (int i = 0; i < node.getChildCount(); i++) { Node n = node.getChild(i); if (!(n instanceof DocType)) { return makeWrapper(n, docWrapper, this, 0); } } } return null; }
writeEscaped(node.getChild(0).getValue()); // string value of atomic value mayBreakLine = false; isPreviousAtomic = true;
public SteppingNode getFirstChild() { if (node.getChildCount() > 0) { for (int i=0; i<node.getChildCount(); i++) { Node n = node.getChild(i); if (!(n instanceof DocType)) { return makeWrapper(n, docWrapper, this, 0); } } } return null; }
/** * Get the following node in an iteration of descendants * * @param start the start node * @param anchor the node marking the root of the subtree within which navigation takes place (may be null) * @return the next node in document order after the start node, excluding attributes and namespaces */ private static Node getSuccessorNode(Node start, Node anchor) { if (start.getChildCount() > 0) { return start.getChild(0); } if (start == anchor) { return null; } Node p = start; while (true) { ParentNode q = p.getParent(); if (q == null) { return null; } int i = q.indexOf(p) + 1; if (i < q.getChildCount()) { return q.getChild(i); } if (q == anchor) { return null; } p = q; } }
/** * Get the following node in an iteration of descendants * * @param start the start node * @param anchor the node marking the root of the subtree within which navigation takes place (may be null) * @return the next node in document order after the start node, excluding attributes and namespaces */ private static Node getSuccessorNode(Node start, Node anchor) { if (start.getChildCount() > 0) { return start.getChild(0); } if (start == anchor) { return null; } Node p = start; while (true) { ParentNode q = p.getParent(); if (q == null) { return null; } int i = q.indexOf(p) + 1; // TODO: inefficient if a node has a large number of children if (i < q.getChildCount()) { return q.getChild(i); } if (q == anchor) { return null; } p = q; } }
/** * Get the following node in an iteration of descendants * * @param start the start node * @param anchor the node marking the root of the subtree within which navigation takes place (may be null) * @return the next node in document order after the start node, excluding attributes and namespaces */ private static Node getSuccessorNode(Node start, Node anchor) { if (start.getChildCount() > 0) { return start.getChild(0); } if (start == anchor) { return null; } Node p = start; while (true) { ParentNode q = p.getParent(); if (q == null) { return null; } int i = q.indexOf(p) + 1; if (i < q.getChildCount()) { return q.getChild(i); } if (q == anchor) { return null; } p = q; } }