Code example for Text

Methods: getNodeValue

0
        if (control == null) {
            return test == null;
        } else if (test == null) {
            return false; 
        } 
        return control.getNodeValue().equals(test.getNodeValue());
    } 
 
    /** 
     * Extract the normalized text from within an element 
     * @param fromElement 
     * @return extracted Text node (could be null) 
     */  
    protected Text extractText(Element fromElement) {
        fromElement.normalize();
        NodeList fromNodeList = fromElement.getChildNodes(); 
        Node currentNode;
        for (int i=0; i < fromNodeList.getLength(); ++i) {
            currentNode = fromNodeList.item(i);
            if (currentNode.getNodeType() == Node.TEXT_NODE) {
                return (Text) currentNode;