All pastes #477649 Raw Edit

Mine

public text v1 · immutable
·published 2007-05-08 19:44 UTC
rendered paste body
	public void readTree (Node currentNode) {
		while (currentNode!=null) {
			System.out.println (currentNode.getNodeName()+"\t"+currentNode.getNodeValue());
			if (currentNode.hasChildNodes()) {
				readTree (currentNode.getFirstChild());
			}
			if (currentNode.getNextSibling()==null) {
				currentNode = currentNode.getParentNode();
				readTree (currentNode.getNextSibling());
			}
			currentNode = currentNode.getNextSibling();
		}
	}