currentNode = currentNode.getParentNode(); } public void characters(char[] ch, int start, int length) throws SAXException { Node node = currentNode.getLastChild(); String s = new String(ch, start, length); if (node != null && node.getNodeType() == Node.TEXT_NODE) { ((Text) node).appendData(s); } else { Text text = getDocument().createTextNode(s); currentNode.appendChild(text); } } public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException { characters(ch, start, length); }