public Object getValue() { if (node instanceof Element) { StringBuffer buf = new StringBuffer(); for (NodeIterator children = childIterator(null, false, null); children.setPosition(children.getPosition() + 1);) { NodePointer ptr = children.getNodePointer(); if (ptr.getImmediateNode() instanceof Element || ptr.getImmediateNode() instanceof Text) { buf.append(ptr.getValue()); } } return buf.toString(); } if (node instanceof Comment) { String text = ((Comment) node).getText(); if (text != null) { text = text.trim(); } return text; } String result = null; if (node instanceof Text) { result = ((Text) node).getText(); } if (node instanceof ProcessingInstruction) { result = ((ProcessingInstruction) node).getData(); } boolean trim = !"preserve".equals(findEnclosingAttribute(node, "space", Namespace.XML_NAMESPACE)); return result != null && trim ? result.trim() : result; }
if (it.setPosition(it.getPosition() + 1)) { currentNodePointer = it.getNodePointer(); if (!isRecursive()) {
if (!reverse) { NodeIterator it = (NodeIterator) stack.peek(); if (it.setPosition(it.getPosition() + 1)) { currentNodePointer = it.getNodePointer(); if (!currentNodePointer.isLeaf()) { if (it.setPosition(it.getPosition() + 1)) { currentNodePointer = it.getNodePointer(); if (!currentNodePointer.isLeaf()) {
return false; if (!iterator.setPosition(iterator.getPosition() + 1)) { return false;
return false; if (!iterator.setPosition(iterator.getPosition() + 1)) { return false;