Package org.dom4j

Examples of org.dom4j.Element.addNamespace()


        // add all namespace declarations to element
        int ncount = m_unmarshalContext.getNamespaceCount();
        for (int i = 0; i < ncount; i++) {
            String prefix = m_unmarshalContext.getNamespacePrefix(i);
            String uri = m_unmarshalContext.getNamespaceUri(i);
            element.addNamespace(prefix, uri);
        }
       
        // add all attributes to element
        int acount = m_unmarshalContext.getAttributeCount();
        for (int i = 0; i < acount; i++) {
View Full Code Here


        DocumentFactory df = new DocumentFactory();

        // serialize the Package
        Element workflowProcessElement = df.createElement(new QName(
                WORKFLOW_PROCESS, FPDL_NS));
        workflowProcessElement.addNamespace(FPDL_NS_PREFIX, FPDL_URI);
//      workflowProcessElement.addNamespace(XSD_NS_PREFIX, XSD_URI);
//      workflowProcessElement.addNamespace(XSI_NS_PREFIX, XSI_URI);
        workflowProcessElement.addAttribute(ID, workflowProcess.getId());
        workflowProcessElement.addAttribute(NAME, workflowProcess.getName());
        workflowProcessElement.addAttribute(DISPLAY_NAME, workflowProcess.getDisplayName());
View Full Code Here

        }
    }

    private String createErrorBody(String type, String condition) {
        Element body = DocumentHelper.createElement("body");
        body.addNamespace("", "http://jabber.org/protocol/httpbind");
        body.addAttribute("type", type);
        body.addAttribute("condition", condition);
        return body.asXML();
    }
View Full Code Here

        }
    }

    private String createSessionRestartResponse(HttpSession session) throws DocumentException {
        Element response = DocumentHelper.createElement("body");
        response.addNamespace("", "http://jabber.org/protocol/httpbind");
        response.addNamespace("stream", "http://etherx.jabber.org/streams");

        Element features = response.addElement("stream:features");
        for (Element feature : session.getAvailableStreamFeaturesElements()) {
            features.add(feature);
View Full Code Here

    }

    private String createSessionRestartResponse(HttpSession session) throws DocumentException {
        Element response = DocumentHelper.createElement("body");
        response.addNamespace("", "http://jabber.org/protocol/httpbind");
        response.addNamespace("stream", "http://etherx.jabber.org/streams");

        Element features = response.addElement("stream:features");
        for (Element feature : session.getAvailableStreamFeaturesElements()) {
            features.add(feature);
        }
View Full Code Here

        response.getOutputStream().close();
    }

    private static String createEmptyBody() {
        Element body = DocumentHelper.createElement("body");
        body.addNamespace("", "http://jabber.org/protocol/httpbind");
        return body.asXML();
    }

    private long getLongAttribue(String value, long defaultValue) {
        if (value == null || "".equals(value)) {
View Full Code Here

    }


    private String createEmptyBody() {
        Element body = DocumentHelper.createElement("body");
        body.addNamespace("", "http://jabber.org/protocol/httpbind");
        long ack = getLastAcknowledged();
        if(ack > lastRequestID)
          body.addAttribute("ack", String.valueOf(ack));
        return body.asXML();
    }
View Full Code Here

        }
    }

    private String createSessionCreationResponse(HttpSession session) throws DocumentException {
        Element response = DocumentHelper.createElement("body");
        response.addNamespace("", "http://jabber.org/protocol/httpbind");
        response.addNamespace("stream", "http://etherx.jabber.org/streams");
        response.addAttribute("authid", session.getStreamID().getID());
        response.addAttribute("sid", session.getStreamID().getID());
        response.addAttribute("secure", Boolean.TRUE.toString());
        response.addAttribute("requests", String.valueOf(session.getMaxRequests()));
View Full Code Here

    }

    private String createSessionCreationResponse(HttpSession session) throws DocumentException {
        Element response = DocumentHelper.createElement("body");
        response.addNamespace("", "http://jabber.org/protocol/httpbind");
        response.addNamespace("stream", "http://etherx.jabber.org/streams");
        response.addAttribute("authid", session.getStreamID().getID());
        response.addAttribute("sid", session.getStreamID().getID());
        response.addAttribute("secure", Boolean.TRUE.toString());
        response.addAttribute("requests", String.valueOf(session.getMaxRequests()));
        response.addAttribute("inactivity", String.valueOf(session.getInactivityTimeout()));
View Full Code Here

    // Configure the document
    xmlDoc = DocumentHelper.createDocument();
    Element rootElem = xmlDoc.addElement(new QName("coreProperties",
        namespaceCoreProperties));
    rootElem.addNamespace("cp", PackagePropertiesPart.NAMESPACE_CP_URI);
    rootElem.addNamespace("dc", PackagePropertiesPart.NAMESPACE_DC_URI);
    rootElem.addNamespace("dcterms",
        PackagePropertiesPart.NAMESPACE_DCTERMS_URI);
    rootElem.addNamespace("xsi", PackagePropertiesPart.NAMESPACE_XSI_URI);
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.