Code example for Node

Methods: getLastChildgetNodeType

0
        if (text.length() == 0) {
            return; 
        } 
        // Merge with any previous text node if possible. 
        if (coalescing) {
            Node lastChild = parent.getLastChild();
            if (lastChild != null && lastChild.getNodeType() == Node.TEXT_NODE) {
                Text textNode = (Text) lastChild;
                textNode.setData(textNode.getNodeValue() + text);
                return; 
            } 
        } 
        // Okay, we really do need a new text node 
        parent.appendChild(token == XmlPullParser.CDSECT
                ? new CDATASectionImpl(document, text)
                : new TextImpl(document, text));
    } 
 
    @Override 
    public void setEntityResolver(EntityResolver resolver) {