Package org.jdom

Examples of org.jdom.Element.addNamespaceDeclaration()


            // if the user didn't pick something else, assign 'tns' as the
            // prefix.
            if (namespaceMap == null || !namespaceMap.containsKey(entry.getKey())) {
                // Schemas are more readable if there is a specific prefix for
                // the TNS.
                e.addNamespaceDeclaration(Namespace.getNamespace(WSDLConstants.CONVENTIONAL_TNS_PREFIX, entry
                    .getKey()));
            }
            e.setAttribute(new Attribute("elementFormDefault", "qualified"));
            e.setAttribute(new Attribute("attributeFormDefault", "qualified"));
View Full Code Here


                    if (additionalNamespaces != null) {
                        for (Iterator<String> iter = additionalNamespaces.keySet().iterator(); iter.hasNext();) {
                            String prefix = iter.next();
                            String uri = additionalNamespaces.get(prefix);

                            newElem.addNamespaceDeclaration(Namespace.getNamespace(prefix, uri));
                        }
                    }
                } else {
                    f.addContent(current, newElem);
                }
View Full Code Here

        if ( releaseDescriptor.isAddSchema() )
        {
            Namespace pomNamespace = Namespace.getNamespace( "", "http://maven.apache.org/POM/" + modelVersion );
            rootElement.setNamespace( pomNamespace );
            Namespace xsiNamespace = Namespace.getNamespace( "xsi", "http://www.w3.org/2001/XMLSchema-instance" );
            rootElement.addNamespaceDeclaration( xsiNamespace );

            if ( rootElement.getAttribute( "schemaLocation", xsiNamespace ) == null )
            {
                rootElement.setAttribute( "schemaLocation", "http://maven.apache.org/POM/" + modelVersion
                    + " http://maven.apache.org/maven-v" + modelVersion.replace( '.', '_' ) + ".xsd", xsiNamespace );
View Full Code Here

                    if (additionalNamespaces != null) {
                        for (Iterator iter = additionalNamespaces.keySet().iterator(); iter.hasNext();) {
                            String prefix = (String)iter.next();
                            String uri = (String)additionalNamespaces.get(prefix);

                            newElem.addNamespaceDeclaration(Namespace.getNamespace(prefix, uri));
                        }
                    }
                } else {
                    f.addContent(current, newElem);
                }
View Full Code Here

                    if (additionalNamespaces != null) {
                        for (Iterator iter = additionalNamespaces.keySet().iterator(); iter.hasNext();) {
                            String prefix = (String)iter.next();
                            String uri = (String)additionalNamespaces.get(prefix);

                            newElem.addNamespaceDeclaration(Namespace.getNamespace(prefix, uri));
                        }
                    }
                } else {
                    f.addContent(current, newElem);
                }
View Full Code Here

                    if (additionalNamespaces != null) {
                        for (Iterator iter = additionalNamespaces.keySet().iterator(); iter.hasNext();) {
                            String prefix = (String)iter.next();
                            String uri = (String)additionalNamespaces.get(prefix);

                            newElem.addNamespaceDeclaration(Namespace.getNamespace(prefix, uri));
                        }
                    }
                } else {
                    f.addContent(current, newElem);
                }
View Full Code Here

                    if (additionalNamespaces != null) {
                        for (Iterator iter = additionalNamespaces.keySet().iterator(); iter.hasNext();) {
                            String prefix = (String)iter.next();
                            String uri = (String)additionalNamespaces.get(prefix);

                            newElem.addNamespaceDeclaration(Namespace.getNamespace(prefix, uri));
                        }
                    }
                } else {
                    f.addContent(current, newElem);
                }
View Full Code Here

     
      Element root = new Element("beans");
      root.setNamespace(springBeansNamespace);
     
      Namespace schemaNS = Namespace.getNamespace("xsi", "http://www.w3.org/2001/XMLSchema-instance");
      root.addNamespaceDeclaration(schemaNS);
      root.setAttribute("schemaLocation", "http://www.springframework.org/schema/beans/spring-beans.xsd", schemaNS);
     
      doc.addContent(root);     
    } else {
      SAXBuilder builder = new SAXBuilder();
View Full Code Here

        return new Document(root);
    }

    protected Element createRootElement(Feed feed) {
        Element root = new Element("feed",getFeedNamespace());
        root.addNamespaceDeclaration(getFeedNamespace());
        Attribute version = new Attribute("version", getVersion());
        root.setAttribute(version);
        if (feed.getXmlBase() != null) {
            root.setAttribute("base", feed.getXmlBase(), Namespace.XML_NAMESPACE);
        }
View Full Code Here

                if (md.getAttribute(schemaLocAtt.getName(), schemaLocAtt.getNamespace()) == null) {
                    md.setAttribute(schemaLocAtt);
                    // make sure namespace declaration for schemalocation is present -
                    // remove it first (does nothing if not there) then add it
                    md.removeNamespaceDeclaration(schemaLocAtt.getNamespace());
                    md.addNamespaceDeclaration(schemaLocAtt.getNamespace());
                }
            }
        } else {
            String schemaDir = sm.getSchemaDir(schema);
            if (Lib.existsConverter(schemaDir, prefix)) {
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.