Package org.jdom

Examples of org.jdom.Element.addNamespaceDeclaration()


        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


        // Create the root element with the appropriate default namespace.
        Element root = factory.element(rootName, namespaceURI);

        // Add the namespace declararion for XMLSchema to root element.
        Namespace xsi = Namespace.getNamespace(XSI, W3CSchemata.XSI_NAMESPACE);
        root.addNamespaceDeclaration(xsi);

        StringBuffer buffer = new StringBuffer(namespaceURI.length() +
                schemaURI.length() + 1);
        buffer.append(namespaceURI)
                .append(' ')
View Full Code Here

            if (null != namespaceMap) { // did application hand us some
                                        // additional namespaces?
                for (Map.Entry<String, String> mapping : namespaceMap.entrySet()) {
                    // user gives us namespace->prefix mapping.
                    e.addNamespaceDeclaration(Namespace.getNamespace(mapping.getValue(), mapping.getKey()));
                }
            }

            // if the user didn't pick something else, assign 'tns' as the
            // prefix.
View Full Code Here

            // 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 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

    Namespace xlink = Namespace.getNamespace("xlink", "http://www.w3.org/1999/xlink");
    this.invcat = Namespace.getNamespace("",
        "http://www.unidata.ucar.edu/namespaces/thredds/InvCatalog/v1.0");
    Namespace xsi = Namespace.getNamespace("xsi", "http://www.w3.org/2001/XMLSchema-instance");
    Element el = new Element("catalog", invcat);
    el.addNamespaceDeclaration(invcat);
    el.addNamespaceDeclaration(xlink);
    el.addNamespaceDeclaration(xsi);
    String location = "http://www.unidata.ucar.edu/namespaces/thredds/InvCatalog/v1.0 "
          + "http://www.unidata.ucar.edu/schemas/thredds/InvCatalog.1.0.2.xsd";
    org.jdom.Attribute attr = new org.jdom.Attribute("schemaLocation", location, xsi);
View Full Code Here

    this.invcat = Namespace.getNamespace("",
        "http://www.unidata.ucar.edu/namespaces/thredds/InvCatalog/v1.0");
    Namespace xsi = Namespace.getNamespace("xsi", "http://www.w3.org/2001/XMLSchema-instance");
    Element el = new Element("catalog", invcat);
    el.addNamespaceDeclaration(invcat);
    el.addNamespaceDeclaration(xlink);
    el.addNamespaceDeclaration(xsi);
    String location = "http://www.unidata.ucar.edu/namespaces/thredds/InvCatalog/v1.0 "
          + "http://www.unidata.ucar.edu/schemas/thredds/InvCatalog.1.0.2.xsd";
    org.jdom.Attribute attr = new org.jdom.Attribute("schemaLocation", location, xsi);
    el.setAttribute(attr);
View Full Code Here

        "http://www.unidata.ucar.edu/namespaces/thredds/InvCatalog/v1.0");
    Namespace xsi = Namespace.getNamespace("xsi", "http://www.w3.org/2001/XMLSchema-instance");
    Element el = new Element("catalog", invcat);
    el.addNamespaceDeclaration(invcat);
    el.addNamespaceDeclaration(xlink);
    el.addNamespaceDeclaration(xsi);
    String location = "http://www.unidata.ucar.edu/namespaces/thredds/InvCatalog/v1.0 "
          + "http://www.unidata.ucar.edu/schemas/thredds/InvCatalog.1.0.2.xsd";
    org.jdom.Attribute attr = new org.jdom.Attribute("schemaLocation", location, xsi);
    el.setAttribute(attr);
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 (null != namespaceMap) { // did application hand us some
                                        // additional namespaces?
                for (Map.Entry<String, String> mapping : namespaceMap.entrySet()) {
                    // user gives us namespace->prefix mapping.
                    e.addNamespaceDeclaration(Namespace.getNamespace(mapping.getValue(), mapping.getKey()));
                }
            }

            // if the user didn't pick something else, assign 'tns' as the
            // 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.