Package org.jdom

Examples of org.jdom.Element.addNamespaceDeclaration()


    protected Element createRootElement(Channel channel) {
        Element root = new Element("RDF",getRDFNamespace());
        root.addNamespaceDeclaration(getFeedNamespace());
        root.addNamespaceDeclaration(getRDFNamespace());
        root.addNamespaceDeclaration(getContentNamespace());
        generateModuleNamespaceDefs(root);
        return root;
    }

    protected void populateFeed(Channel channel, Element parent) throws FeedException  {
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

            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

        assertNotNull("no type found for " + instance.getClass().getName());

        // create the document
        Element element = new Element("root", "b", "urn:Bean");
        for (Map.Entry<String, String> entry : getNamespaces().entrySet()) {
            element.addNamespaceDeclaration(Namespace.getNamespace(entry.getKey(), entry.getValue()));
        }
        new Document(element);
        JDOMWriter rootWriter = new JDOMWriter(element);
        Context context = getContext();
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 (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 ( 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

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.