Code example for Element

Methods: getChildNodes, getParentNode

0
 
    /** 
     * Scan through org.w3c.dom.Element named href. 
     */ 
    void visitElement_href(org.w3c.dom.Element element) {
        String parentNode = element.getParentNode().getNodeName();
        if(element.getChildNodes().getLength() == 0)
            return; 
        if ("Icon".equals(parentNode)) {
            kmlType.getDocument().getLastStyle().getIconstyle().getIcon().setHref(element.getChildNodes().item(0).getNodeValue());
        } 
    } 
 
    /** 
     * Scan through org.w3c.dom.Element named LineStyle. 
     */ 
    void visitElement_LineStyle(org.w3c.dom.Element element) {
        org.w3c.dom.NodeList nodes = element.getChildNodes();
        for (int i = 0; i < nodes.getLength(); i++) {
            org.w3c.dom.Node node = nodes.item(i);
            switch (node.getNodeType()) {