Package org.dom4j

Examples of org.dom4j.Namespace


                            List allNs = element.declaredNamespaces();
                            Iterator itNs = allNs.iterator();

                            while (itNs.hasNext())
                            {
                                Namespace namespace = (Namespace)itNs.next();
                                WebBeansNameSpaceContainer.getInstance().addNewPackageNameSpace(namespace.getURI());
                            }
                        }
                    }
                }
View Full Code Here


    public static boolean isElementInNamespace(Element element, String namespace)
    {
        Asserts.assertNotNull(element, "element parameter can not be null");
        Asserts.assertNotNull(namespace, "namespace parameter can not be null");

        Namespace ns = element.getNamespace();
        if (!Namespace.NO_NAMESPACE.equals(ns))
        {
            if (ns.getURI().equals(namespace))
            {
                return true;
            }
        }
View Full Code Here

    public static String getElementNameSpace(Element element)
    {
        nullCheckForElement(element);

        Namespace ns = element.getNamespace();
        if (!Namespace.NO_NAMESPACE.equals(ns))
        {
            return ns.getURI();
        }

        return null;
    }
View Full Code Here

                .createPart(
                        corePartName,
                        "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml");

        Document doc = DocumentHelper.createDocument();
        Namespace nsWordprocessinML = new Namespace("w",
                "http://schemas.openxmlformats.org/wordprocessingml/2006/main");
        Element elDocument = doc.addElement(new QName("document",
                nsWordprocessinML));
        Element elBody = elDocument.addElement(new QName("body",
                nsWordprocessinML));
View Full Code Here

              .getTargetURI())));
    }

    // Create a content
    Document doc = DocumentHelper.createDocument();
    Namespace nsWordprocessinML = new Namespace("w",
        "http://schemas.openxmlformats.org/wordprocessingml/2006/main");
    Element elDocument = doc.addElement(new QName("document",
        nsWordprocessinML));
    Element elBody = elDocument.addElement(new QName("body",
        nsWordprocessinML));
View Full Code Here

        }
    }

    public String getDefaultNamespaceURI()
    {
        Namespace namespace = this.document.getRootElement().getNamespace();
        return namespace.getURI();
    }
View Full Code Here

            map.put("type", "text/xsl");
            map.put("href", xsltPath);
            dom.addProcessingInstruction("xml-stylesheet", map);
        }

        Namespace opensearchNs = DocumentHelper.createNamespace("opensearch", XMLNS_A9_OPENSEARCH_1_0);
        Namespace hounderNs = DocumentHelper.createNamespace("hounder", XMLNS_HOUNDER_OPENSEARCH_1_0);
        Element root;
        Element channel;
        if (!useXslt) {
            root = dom.addElement("rss").
            addAttribute("version", "2.0");
View Full Code Here

    {
        Element muleHeader = null;

        if (correlationId != null || replyTo != null)
        {
            muleHeader = new DOMElement(new QName(MULE_HEADER, new Namespace(MULE_NAMESPACE, MULE_10_ACTOR)));
        }
        else
        {
            return null;
        }

        if (correlationId != null)
        {
            Node e = muleHeader.appendChild(new DOMElement(new QName(
                MuleProperties.MULE_CORRELATION_ID_PROPERTY, new Namespace(MULE_NAMESPACE, MULE_10_ACTOR))));
            e.setNodeValue(correlationId);

            e = muleHeader.appendChild(new DOMElement(new QName(
                MuleProperties.MULE_CORRELATION_GROUP_SIZE_PROPERTY, new Namespace(MULE_NAMESPACE,
                    MULE_10_ACTOR))));
            e.setNodeValue(correlationGroup);

            e = muleHeader.appendChild(new DOMElement(new QName(
                MuleProperties.MULE_CORRELATION_SEQUENCE_PROPERTY, new Namespace(MULE_NAMESPACE,
                    MULE_10_ACTOR))));
            e.setNodeValue(correlationSequence);
        }
        if (replyTo != null)
        {

            Node e = muleHeader.appendChild(new DOMElement(new QName(MuleProperties.MULE_REPLY_TO_PROPERTY,
                new Namespace(MULE_NAMESPACE, MULE_10_ACTOR))));
            e.setNodeValue(replyTo);
        }
        return muleHeader;
    }
View Full Code Here

        if (!(session instanceof ClientSession) && !(session instanceof IncomingServerSession)) {
            return null;
        }

        Element mechs = DocumentHelper.createElement(new QName("mechanisms",
                new Namespace("", "urn:ietf:params:xml:ns:xmpp-sasl")));
        if (session instanceof IncomingServerSession) {
            // Server connections dont follow the same rules as clients
            if (session.isSecure()) {
                // Offer SASL EXTERNAL only if TLS has already been negotiated
                Element mechanism = mechs.addElement("mechanism");
View Full Code Here

        // Include Stream Compression Mechanism
        if (conn.getCompressionPolicy() != Connection.CompressionPolicy.disabled &&
                !conn.isCompressed()) {
            Element compression = DocumentHelper.createElement(new QName("compression",
                    new Namespace("", "http://jabber.org/features/compress")));
            Element method = compression.addElement("method");
            method.setText("zlib");

            elements.add(compression);
        }
        Element bind = DocumentHelper.createElement(new QName("bind",
                new Namespace("", "urn:ietf:params:xml:ns:xmpp-bind")));
        elements.add(bind);

        Element session = DocumentHelper.createElement(new QName("session",
                new Namespace("", "urn:ietf:params:xml:ns:xmpp-session")));
        elements.add(session);
        return elements;
    }
View Full Code Here

TOP

Related Classes of org.dom4j.Namespace

Copyright © 2018 www.massapicom. 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.