Package org.apache.axiom.om

Examples of org.apache.axiom.om.OMElement.declareNamespace()


                    throw new RuntimeException("Operation: " + operationName + " takes " + parameterTypes.length +
                        " argument(s), and 'arguments' only contains: " + arguments.length);
                }

                // - declare all the namespaces
                operationOMElement.declareNamespace(xsiNamespace);
                for (final OMNamespace namespace : namespaces.values())
                {
                    operationOMElement.declareNamespace(namespace);
                }
View Full Code Here


                // - declare all the namespaces
                operationOMElement.declareNamespace(xsiNamespace);
                for (final OMNamespace namespace : namespaces.values())
                {
                    operationOMElement.declareNamespace(namespace);
                }

                // - add the argument children
                for (int ctr = 0; ctr < argumentElements.size(); ctr++)
                {
View Full Code Here

            }
        }

        OMElement code = fac.createOMElement("code", synNS, fault);
        if (mediator.getFaultCodeValue() != null) {
            OMNamespace ns = code.declareNamespace(mediator.getFaultCodeValue().getNamespaceURI(),
                    mediator.getFaultCodeValue().getPrefix());
            code.addAttribute(fac.createOMAttribute(
                    "value", nullNS, ns.getPrefix() + ":"
                    + mediator.getFaultCodeValue().getLocalPart()));
View Full Code Here

                header.addAttribute(fac.createOMAttribute(
                    "name", nullNS,
                    (qName.getPrefix() != null && !"".equals(qName.getPrefix())
                        ? qName.getPrefix() + ":" : "") +
                    qName.getLocalPart()));
                header.declareNamespace(qName.getNamespaceURI(), qName.getPrefix());
            } else {
                header.addAttribute(fac.createOMAttribute(
                    "name", nullNS, qName.getLocalPart()));
            }
        }
View Full Code Here

        super(metaFactory);
    }

    protected void runTest() throws Throwable {
        OMElement element = metaFactory.getOMFactory().createOMElement(new QName("test"));
        OMNamespace ns = element.declareNamespace("urn:ns1", "ns1");
        assertEquals("urn:ns1", ns.getNamespaceURI());
        assertEquals("ns1", ns.getPrefix());
        Iterator it = element.getAllDeclaredNamespaces();
        assertTrue(it.hasNext());
        OMNamespace ns2 = (OMNamespace)it.next();
View Full Code Here

    private OMElement getSampleDocumentElement(OMNamespace testNamespace) {
        OMFactory factory = OMAbstractFactory.getOMFactory();

        OMElement documentElement = factory.createOMElement("Employees", testNamespace);
        documentElement.declareNamespace(testNamespace);

        OMElement employee;
        OMElement name;

        for (int i = 0; i < 5; i++) {
View Full Code Here

        String NSURI = "http://testns";
        String NSURI_UPPER = "HTTP://TESTNS";

        OMFactory fac = metaFactory.getOMFactory();
        OMElement el = fac.createOMElement("foo", null);
        el.declareNamespace(NSURI, "p");
        assertNull(el.findNamespace(NSURI_UPPER, "p"));
    }
}
View Full Code Here

    }

    protected void runTest() throws Throwable {
        OMFactory factory = metaFactory.getOMFactory();
        OMElement element = factory.createOMElement(new QName("test"));
        OMNamespace ns = element.declareNamespace("urn:ns", "");
        assertEquals("urn:ns", ns.getNamespaceURI());
        assertNotNull(ns.getPrefix());
        assertTrue(ns.getPrefix().length() > 0);
        Iterator it = element.getAllDeclaredNamespaces();
        assertTrue(it.hasNext());
View Full Code Here

         */

        OMFactory omFac = metaFactory.getOMFactory();

        OMElement documentElement = omFac.createOMElement("RootElement", null);
        OMNamespace ns1 = documentElement.declareNamespace("http://one.org", "ns1");
        OMNamespace ns2 = documentElement.declareNamespace("http://one.org", "ns2");

        OMElement childOne = omFac.createOMElement("ChildElementOne", ns2, documentElement);
        childOne.declareDefaultNamespace("http://one.org");

View Full Code Here

        OMFactory omFac = metaFactory.getOMFactory();

        OMElement documentElement = omFac.createOMElement("RootElement", null);
        OMNamespace ns1 = documentElement.declareNamespace("http://one.org", "ns1");
        OMNamespace ns2 = documentElement.declareNamespace("http://one.org", "ns2");

        OMElement childOne = omFac.createOMElement("ChildElementOne", ns2, documentElement);
        childOne.declareDefaultNamespace("http://one.org");

        OMElement childTwo = omFac.createOMElement("ChildElementTwo", ns1, childOne);
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.