Code example for Element

Methods: getParentNode

0
 
    /** 
     * Scan through org.w3c.dom.Element named width. 
     */ 
    void visitElement_width(org.w3c.dom.Element element) {
        String parentNode = element.getParentNode().getNodeName();
        if ("LineStyle".equals(parentNode)) {
            kmlType.getDocument().getLastStyle().getLinestyle().setWidth(Float.valueOf(element.getChildNodes().item(0).getNodeValue()));
        } 
    } 
 
    /** 
     * Scan through org.w3c.dom.Element named Placemark. 
     */ 
    void visitElement_Placemark(org.w3c.dom.Element element) {
        kmlType.getDocument().getPlacemarks().add(new PlacemarkType());
        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()) {
                case org.w3c.dom.Node.CDATA_SECTION_NODE: