Package org.w3c.dom

Examples of org.w3c.dom.Element


    appendElement(tldTag, "bodycontent", childText(tmlTag, "bodycontent"));
    appendElement(tldTag, "info", childText(tmlTag, "description"));
   
    NodeList attributes = tmlTag.getElementsByTagName("attribute");
    for(int i = 0; i < attributes.getLength(); i++) {
      Element attr = (Element) attributes.item(i);
      copyAttribute(attr, appendElement(tldTag, "attribute"));
    }
    NodeList groups = ((Element) tmlTag.getElementsByTagName("attributeGroups").item(0)).getElementsByTagName("string");
    for(int i = 0; i < groups.getLength(); i++) {
      String name = groups.item(i).getTextContent();
      NodeList attributes2 = this.attributeGroups.get(name);
      for(int j = 0; j < attributes2.getLength(); j++) {
        Element attr = (Element) attributes2.item(j);
        copyAttribute(attr, appendElement(tldTag, "attribute"));
      }     
    }
    Element sorucelineAttr = appendElement(tldTag, "attribute");
    appendElement(sorucelineAttr, "name", "sourceline");
    appendElement(sorucelineAttr, "required", "false");
    appendElement(sorucelineAttr, "rtexprvalue", "false");
   
  }
View Full Code Here


  private Element createElement(String tagName) {
    return tld.createElement(tagName);
  }
 
  private Element createElement(String tagName, String text) {
    Element e = createElement(tagName);
    e.setTextContent(text);
    return e;
  }
View Full Code Here

    e.setTextContent(text);
    return e;
  }

  private Element appendElement(Element parent, String tagName) {
    Element e = createElement(tagName);
    parent.appendChild(e);
    return e;
  }
View Full Code Here

    parent.appendChild(e);
    return e;
  }
 
  private void appendElement(Element parent, String tagName, String text) {
    Element e = createElement(tagName, text);
    parent.appendChild(e);
  }
View Full Code Here

    private MappingNode recursiveLoadContents(Collection mappingChildren, MappingBaseNode parent)
        throws MappingException {
       
        MappingBaseNode node = null;
        for (Iterator i = mappingChildren.iterator(); i.hasNext();){
            Element elem = (Element)i.next();

            node = processMappingNode(elem, parent);

            Collection childrenMappingNodes = getChildren(elem, MappingNodeConstants.Tags.MAPPING_NODE_NAME);
            recursiveLoadContents(childrenMappingNodes, node);
View Full Code Here

     */
    private Namespace[] getNamespaceDeclarations(Element element) {
        ArrayList namespaces = new ArrayList();
        Iterator elements = getChildren(element, MappingNodeConstants.Tags.NAMESPACE_DECLARATION).iterator();
        while (elements.hasNext()){
            Element namespace = (Element)elements.next();
            Element prefixEl = getElement(namespace, MappingNodeConstants.Tags.NAMESPACE_DECLARATION_PREFIX);
            Element uriEl = getElement(namespace, MappingNodeConstants.Tags.NAMESPACE_DECLARATION_URI);
            String prefix = (prefixEl != null ? getTextTrim(prefixEl) : MappingNodeConstants.DEFAULT_NAMESPACE_PREFIX);
            String uri = getTextTrim(uriEl);
            namespaces.add(new Namespace(prefix, uri));
        }
        return (Namespace[])namespaces.toArray(new Namespace[namespaces.size()]);
View Full Code Here

    Element getElement( Element element, String childName ) {
        return getChild(element, childName);
    }

    String getElementValue( Element element, String childName ) {
        Element child = getChild(element, childName);
        return getTextTrim(child);
    }
View Full Code Here

        Element child = getChild(element, childName);
        return getTextTrim(child);
    }
   
    String getElementValue( Element element, String childName , String defalt) {
        Element child = getChild(element, childName);
        String result = getTextTrim(child);
        if (result == null) {
          return defalt;
        }
        return result;
View Full Code Here

        }
        return result;
    }   
   
    int getIntElementValue( Element element, String childName , int defalt) {
        Element child = getChild(element, childName);
        if (child != null) {
            return Integer.valueOf(getTextTrim(child)).intValue();
        }
        return defalt;
    }
View Full Code Here

        }
        return defalt;
    }
   
    boolean getBooleanElementValue( Element element, String childName , boolean defalt) {
        Element child = getChild(element, childName);
        if (child != null) {
            return Boolean.valueOf(getTextTrim(child)).booleanValue();
        }
        return defalt;
    }
View Full Code Here

TOP

Related Classes of org.w3c.dom.Element

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.