Package org.dom4j

Examples of org.dom4j.Element.addNamespace()


        // <xsd:schema>
        Element schemaRoot = doc.addElement("xsd:schema", W3C_XML_SCHEMA_NS_URI);

        schemaRoot.addNamespace("xsd", W3C_XML_SCHEMA_NS_URI);
        schemaRoot.addNamespace("beans", BEANS_NAMESPACE_URI);
        schemaRoot.addNamespace("springext", SPRINGEXT_BASE_URI);
        schemaRoot.addNamespace("", configurationPoint.getNamespaceUri());

        schemaRoot.addAttribute("targetNamespace", configurationPoint.getNamespaceUri());

        // <xsd:include schemaLocation="contribution schema" />
View Full Code Here


        Element schemaRoot = doc.addElement("xsd:schema", W3C_XML_SCHEMA_NS_URI);

        schemaRoot.addNamespace("xsd", W3C_XML_SCHEMA_NS_URI);
        schemaRoot.addNamespace("beans", BEANS_NAMESPACE_URI);
        schemaRoot.addNamespace("springext", SPRINGEXT_BASE_URI);
        schemaRoot.addNamespace("", configurationPoint.getNamespaceUri());

        schemaRoot.addAttribute("targetNamespace", configurationPoint.getNamespaceUri());

        // <xsd:include schemaLocation="contribution schema" />
        Set<String> includings = createTreeSet();
View Full Code Here

    public static Transformer getTransformerWhoAddsIndirectIncludes(final Map<String, Schema> includes) {
        return new Transformer() {
            public void transform(Document document, String systemId) {
                Element root = document.getRootElement();

                root.addNamespace("xsd", W3C_XML_SCHEMA_NS_URI);

                // <xsd:schema>
                if (W3C_XML_SCHEMA_NS_URI.equals(root.getNamespaceURI()) && "schema".equals(root.getName())) {
                    Namespace xsd = DocumentHelper.createNamespace("xsd", W3C_XML_SCHEMA_NS_URI);
                    QName includeName = DocumentHelper.createQName("include", xsd);
View Full Code Here

/* 420 */         int nsStart = pp.getNamespaceCount(pp.getDepth() - 1);
/* 421 */         int nsEnd = pp.getNamespaceCount(pp.getDepth());
/*     */
/* 423 */         for (int i = nsStart; i < nsEnd; i++) {
/* 424 */           if (pp.getNamespacePrefix(i) != null) {
/* 425 */             newElement.addNamespace(pp.getNamespacePrefix(i), pp.getNamespaceUri(i));
/*     */           }
/*     */
/*     */         }
/*     */
/* 430 */         for (int i = 0; i < pp.getAttributeCount(); i++) {
View Full Code Here

/* 523 */       elem.addAttribute(createQName(attr.getName()), attr.getValue());
/*     */     }
/*     */
/* 527 */     for (Iterator i = startEvent.getNamespaces(); i.hasNext(); ) {
/* 528 */       javax.xml.stream.events.Namespace ns = (javax.xml.stream.events.Namespace)i.next();
/* 529 */       elem.addNamespace(ns.getPrefix(), ns.getNamespaceURI());
/*     */     }
/*     */
/* 532 */     return elem;
/*     */   }
/*     */
View Full Code Here

        Document doc = DocumentHelper.createDocument();

        Element root = DocumentHelper.createElement( "project" );

        root.add( DEFAULT_NAMESPACE );
        root.addNamespace( "xsi", "http://www.w3.org/2001/XMLSchema-instance" );
        root.addAttribute( "xsi:schemaLocation",
                           "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd" );

        doc.setRootElement( root );
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.