All pastes #477676 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-05-08 20:00 UTC
rendered paste body
	// YOUPI MA FONCTION RECURSIVE MARCHE 
	// POURQUOI ? 
	// JE SAIS PLUS :P
	public void readTree (Node currentNode) {
		while (currentNode!=null) {
			System.out.println (currentNode.getNodeName()+"\t"+currentNode.getNodeValue());
			if (currentNode.hasChildNodes()) {
				readTree (currentNode.getFirstChild());
			}
			if (currentNode==null) {
				currentNode = currentNode.getParentNode().getNextSibling();
				readTree (currentNode);
			}
			currentNode = currentNode.getNextSibling();
		}
	}