Package org.w3c.dom

Examples of org.w3c.dom.Document.createElementNS()


        BindingOperationEntry boEntry;
        for (Iterator boeIter = boeToInputMessageMap.keySet().iterator();
             boeIter.hasNext();) {

            boEntry = (BindingOperationEntry) boeIter.next();
            elementDeclaration = document.createElementNS(
                    XMLSCHEMA_NAMESPACE_URI, xsdPrefix + ":"
                                             + XML_SCHEMA_ELEMENT_LOCAL_NAME);
            elementDeclaration.setAttribute(XSD_NAME, boEntry.getBindingOperation().getName());

            //when creating the inner complex type we have to find the parts list from the binding input
View Full Code Here


             boeIterator.hasNext();) {
            boEntry = (BindingOperationEntry) boeIterator.next();
            String baseoutputOpName = boEntry.getBindingOperation().getName();
            // see basic profile 4.7.19
            String outputOpName = baseoutputOpName + WRAPPED_OUTPUTNAME_SUFFIX;
            elementDeclaration = document.createElementNS(
                    XMLSCHEMA_NAMESPACE_URI, xsdPrefix + ":"
                                             + XML_SCHEMA_ELEMENT_LOCAL_NAME);
            elementDeclaration.setAttribute(XSD_NAME, outputOpName);

            BindingOutput bindingOutput = boEntry.getBindingOperation().getBindingOutput();
View Full Code Here

        addTestProperty("newChildHasSiblings", String.valueOf(newChildHasSiblings));
    }

    protected final void runTest() throws Throwable {
        Document doc = dbf.newDocumentBuilder().newDocument();
        Element newChild = doc.createElementNS(null, "newChild");
        if (newChildHasSiblings) {
            Element parent = doc.createElementNS(null, "parent");
            parent.appendChild(doc.createComment("previous sibling"));
            parent.appendChild(newChild);
            parent.appendChild(doc.createComment("next sibling"));
View Full Code Here

    protected final void runTest() throws Throwable {
        Document doc = dbf.newDocumentBuilder().newDocument();
        Element newChild = doc.createElementNS(null, "newChild");
        if (newChildHasSiblings) {
            Element parent = doc.createElementNS(null, "parent");
            parent.appendChild(doc.createComment("previous sibling"));
            parent.appendChild(newChild);
            parent.appendChild(doc.createComment("next sibling"));
        }
        runTest(doc, newChild);
View Full Code Here

        Element child2 = document1.createElementNS(null, "child2");
        Element child3 = document1.createElementNS(null, "child3");
        parent.appendChild(child1);
        parent.appendChild(child2);
        parent.appendChild(child3);
        Element replacementChild = document2.createElementNS(null, "newchild");
        try {
            parent.replaceChild(replacementChild, child2);
            fail("Expected DOMException");
        } catch (DOMException ex) {
            assertEquals(DOMException.WRONG_DOCUMENT_ERR, ex.code);
View Full Code Here

        super(dbf);
    }

    protected void runTest() throws Throwable {
        Document document = dbf.newDocumentBuilder().newDocument();
        Element element = document.createElementNS(null, "test");
       
        // Add the original attribute
        Attr attr = document.createAttributeNS("urn:test", "p1:attr");
        attr.setValue("value1");
        element.setAttributeNodeNS(attr);
View Full Code Here

    protected void runTest() throws Throwable {
        Document document = dbf.newDocumentBuilder().newDocument();
        Attr attr = document.createAttributeNS(null, "attr");
        attr.appendChild(document.createTextNode("foo"));
        attr.appendChild(document.createTextNode("bar"));
        Element element = document.createElementNS(null, "test");
        element.setAttributeNodeNS(attr);
        Element clonedElement = (Element)element.cloneNode(false);
        Attr clonedAttr = clonedElement.getAttributeNodeNS(null, "attr");
        NodeList children = clonedAttr.getChildNodes();
        assertEquals(2, children.getLength());
View Full Code Here

        super(dbf);
    }

    protected void runTest() throws Throwable {
        Document document = dbf.newDocumentBuilder().newDocument();
        Element element = document.createElementNS(null, "test");
        try {
            element.setPrefix("p");
            fail("Expected DOMException");
        } catch (DOMException ex) {
            assertEquals(DOMException.NAMESPACE_ERR, ex.code);
View Full Code Here

        }
        if (!create) {
            return null;
        }
        Document doc = DOMUtils.createDocument();
        Element el = doc.createElementNS(WSConstants.WSSE_NS, "wsse:Security");
        el.setAttributeNS(WSConstants.XMLNS_NS, "xmlns:wsse", WSConstants.WSSE_NS);
        SoapHeader sh = new SoapHeader(new QName(WSConstants.WSSE_NS, "Security"), el);
        sh.setMustUnderstand(true);
        message.getHeaders().add(sh);
        return sh;
View Full Code Here

        NodeBuilder builder = null;
        if (nodeType == Node.ELEMENT_NODE) {
            Element element = null;
            if (getDigester().getNamespaceAware()) {
                element =
                    doc.createElementNS(namespaceURI, name);
                for (int i = 0; i < attributes.getLength(); i++) {
                    element.setAttributeNS(attributes.getURI(i),
                                           attributes.getLocalName(i),
                                           attributes.getValue(i));
                }
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.