Package org.jdom

Examples of org.jdom.Element.addNamespaceDeclaration()


            e.setAttribute(new Attribute(WSDLConstants.ATTR_TNS, entry.getKey()));
           
            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

      String eventString = "";

      Namespace meterNS = Namespace.getNamespace("meter", "http://schemas.google.com/meter/2008");
      Element meterElement = new Element("entry");
      meterElement.addNamespaceDeclaration(meterNS);

      Element categoryElement = new Element("category");
      categoryElement.setAttribute("scheme", "http://schemas.google.com/g/2005#kind");
      categoryElement.setAttribute("term", "http://schemas.google.com/meter/2008#durMeasurement");
View Full Code Here

    for (PowerEvent event : events) {
      String eventString = "";

      Namespace meterNS = Namespace.getNamespace("meter", "http://schemas.google.com/meter/2008");
      Element meterElement = new Element("entry");
      meterElement.addNamespaceDeclaration(meterNS);

      Element categoryElement = new Element("category");
      categoryElement.setAttribute("scheme", "http://schemas.google.com/g/2005#kind");
      categoryElement.setAttribute("term", "http://schemas.google.com/meter/2008#instMeasurement");
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

    protected Element createRootElement(Channel channel) {
        Element root = new Element("rss",getFeedNamespace());
        Attribute version = new Attribute("version", getVersion());
        root.setAttribute(version);
        root.addNamespaceDeclaration(getContentNamespace());
        generateModuleNamespaceDefs(root);
        return root;
    }

    protected void populateFeed(Channel channel,Element parent) throws FeedException  {
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);
        generateModuleNamespaceDefs(root);
        return root;
    }
View Full Code Here

        return new Document(root);
    }

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

    }

    protected Element createRootElement(Channel channel) {
        Element root = new Element("RDF",getRDFNamespace());
        root.addNamespaceDeclaration(getFeedNamespace());
        root.addNamespaceDeclaration(getRDFNamespace());
        root.addNamespaceDeclaration(getContentNamespace());
        generateModuleNamespaceDefs(root);
        return 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.