Package org.dom4j.tree

Examples of org.dom4j.tree.DefaultAttribute


            }
        }
        else if (node instanceof ProcessingInstruction) {
            ProcessingInstruction pi = (ProcessingInstruction)node;
            if ("target".equals(localName)) {
                result.add(new DefaultAttribute("target", pi.getTarget()));
            }
            else if ("data".equals(localName)) {
                result.add(new DefaultAttribute("data", pi.getText()));
            }
            else {
                result.add(new DefaultAttribute(localName, pi.getValue(localName)));
            }
        } else if (node instanceof DocumentType) {
            DocumentType doctype = (DocumentType)node;
            if ("publicId".equals(localName)) {
                result.add(new DefaultAttribute("publicId", doctype.getPublicID()));
            }
            else if ("systemId".equals(localName)) {
                result.add(new DefaultAttribute("systemId", doctype.getSystemID()));
            }
            else if ("elementName".equals(localName)) {
                result.add(new DefaultAttribute("elementName", doctype.getElementName()));
            }
        }
    }
View Full Code Here


      return new BeanElement(qname, bean);
    }
  }

  public Attribute createAttribute(Element owner, QName qname, String value) {
    return new DefaultAttribute(qname, value);
  }
View Full Code Here

  public void buildDocument(DefaultDocument doc) {
    // Manifest is the root-node of the document, therefore we need to pass the
    // "doc"
    DefaultElement manifestElement = new DefaultElement(CPCore.MANIFEST);

    manifestElement.add(new DefaultAttribute(CPCore.IDENTIFIER, this.identifier));
    manifestElement.add(new DefaultAttribute(CPCore.SCHEMALOCATION, this.schemaLocation));
    // manifestElement.setNamespace(this.getNamespace()); //FIXME: namespace

    doc.add(manifestElement);

    if (metadata != null) {
View Full Code Here

            }
        }
        else if (node instanceof ProcessingInstruction) {
            ProcessingInstruction pi = (ProcessingInstruction)node;
            if ("target".equals(localName)) {
                result.add(new DefaultAttribute("target", pi.getTarget()));
            }
            else if ("data".equals(localName)) {
                result.add(new DefaultAttribute("data", pi.getText()));
            }
            else {
                result.add(new DefaultAttribute(localName, pi.getValue(localName)));
            }
        } else if (node instanceof DocumentType) {
            DocumentType doctype = (DocumentType)node;
            if ("publicId".equals(localName)) {
                result.add(new DefaultAttribute("publicId", doctype.getPublicID()));
            }
            else if ("systemId".equals(localName)) {
                result.add(new DefaultAttribute("systemId", doctype.getSystemID()));
            }
            else if ("elementName".equals(localName)) {
                result.add(new DefaultAttribute("elementName", doctype.getElementName()));
            }
        }
    }
View Full Code Here

    public Element createElement(String qualifiedName, String namespaceURI) {
        return createElement(createQName(qualifiedName, namespaceURI));
    }

    public Attribute createAttribute(Element owner, QName qname, String value) {
        return new DefaultAttribute(qname, value);
    }
View Full Code Here

            return new BeanElement(qname, bean);
        }
    }

    public Attribute createAttribute(Element owner, QName qname, String value) {
        return new DefaultAttribute(qname, value);
    }
View Full Code Here

    {

        Namespace ns1 = Namespace.get("p1", "www.acme1.org");
        Namespace ns2 = Namespace.get("p2", "www.acme2.org");
        Element element = new DefaultElement("test", ns1);
        Attribute attribute = new DefaultAttribute("pre:foo", "bar", ns2);
        element.add(attribute);
        Document doc = new DefaultDocument(element);
       
        XPath xpath = new Dom4jXPath( "//namespace::node()" );
        List results = xpath.selectNodes( doc );
View Full Code Here

    {
            Namespace ns0 = Namespace.get("p0", "www.acme0.org");
            Namespace ns1 = Namespace.get("p1", "www.acme1.org");
            Namespace ns2 = Namespace.get("p2", "www.acme2.org");
            Element element = new DefaultElement("test", ns1);
            Attribute attribute = new DefaultAttribute("pre:foo", "bar", ns2);
            element.add(attribute);
            Element root = new DefaultElement("root", ns0);
            root.add(element);
            Document doc = new DefaultDocument(root);
           
View Full Code Here

/*     */   public Element createElement(String qualifiedName, String namespaceURI) {
/* 152 */     return createElement(createQName(qualifiedName, namespaceURI));
/*     */   }
/*     */
/*     */   public Attribute createAttribute(Element owner, QName qname, String value) {
/* 156 */     return new DefaultAttribute(qname, value);
/*     */   }
View Full Code Here

/* 63 */     return new BeanElement(qname, bean);
/*    */   }
/*    */
/*    */   public Attribute createAttribute(Element owner, QName qname, String value)
/*    */   {
/* 68 */     return new DefaultAttribute(qname, value);
/*    */   }
View Full Code Here

TOP

Related Classes of org.dom4j.tree.DefaultAttribute

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.