Package org.apache.axiom.om

Examples of org.apache.axiom.om.OMFactory.createOMNamespace()


    protected void runTest() throws Throwable {
        OMFactory f = metaFactory.getOMFactory();

        // Create OMSE with a DUMMYPREFIX prefix even though the underlying element uses the default prefix
        OMNamespace rootNS = f.createOMNamespace("http://sampleroot", "rootPrefix");
        OMNamespace ns = f.createOMNamespace("", "");
        OMElement element =
                f.createOMElement(new TestDataSource(testDocument3), "library", ns);
        OMElement root = f.createOMElement("root", rootNS);
        root.addChild(element);
View Full Code Here


        super(metaFactory);
    }

    protected void runTest() throws Throwable {
        OMFactory factory = metaFactory.getOMFactory();
        OMNamespace ns = factory.createOMNamespace("urn:test", "p");
        OMElement parent = factory.createOMElement("parent", ns);
        OMElement child = factory.createOMElement("child", null, parent);
        child.setNamespace(ns);
        assertEquals(new QName("urn:test", "child"), child.getQName());
        assertEquals(ns, child.getNamespace());
View Full Code Here

    protected void runTest() throws Throwable {
        OMFactory f = metaFactory.getOMFactory();

        // Create OMSE with an unknown prefix
        OMNamespace rootNS = f.createOMNamespace("http://sampleroot", "rootPrefix");
        OMNamespace ns =
                f.createOMNamespace("http://www.sosnoski.com/uwjws/library", null);
        OMElement element =
                f.createOMElement(new TestDataSource(testDocument), "library", ns);
        OMElement root = f.createOMElement("root", rootNS);
View Full Code Here

        OMFactory f = metaFactory.getOMFactory();

        // Create OMSE with an unknown prefix
        OMNamespace rootNS = f.createOMNamespace("http://sampleroot", "rootPrefix");
        OMNamespace ns =
                f.createOMNamespace("http://www.sosnoski.com/uwjws/library", null);
        OMElement element =
                f.createOMElement(new TestDataSource(testDocument), "library", ns);
        OMElement root = f.createOMElement("root", rootNS);
        root.addChild(element);
View Full Code Here

        super(metaFactory);
    }

    protected void runTest() throws Throwable {
        OMFactory factory = metaFactory.getOMFactory();
        OMElement parent = factory.createOMElement("parent", factory.createOMNamespace("urn:test", "p"));
        final String[] resultHolder = new String[1];
        OMElement element = factory.createOMElement(new AbstractPushOMDataSource() {
            public void serialize(XMLStreamWriter writer) throws XMLStreamException {
                resultHolder[0] = writer.getNamespaceContext().getNamespaceURI("p");
                writer.writeStartElement(null, "root", null);
View Full Code Here

        InputStreamDataSource isds1 = new InputStreamDataSource(new ByteArrayInputStream(payload1.getBytes(ENCODING)), ENCODING);
        InputStreamDataSource isds2 = new InputStreamDataSource(new ByteArrayInputStream(payload2.getBytes(ENCODING)), ENCODING);
       
        OMFactory factory = metaFactory.getOMFactory();
        OMElement parent = factory.createOMElement("parent", null);
        OMSourcedElement omse = factory.createOMElement(bads1, "myPayload", factory.createOMNamespace("urn://test", "tns"));
        parent.addChild(omse);
        OMNode firstChild = parent.getFirstOMChild();
        assertTrue("Expected OMSourcedElement child", firstChild instanceof OMSourcedElement);
        OMSourcedElement child = (OMSourcedElement) firstChild;
        assertTrue("OMSourcedElement is expanded.  This is unexpected", !child.isExpanded());
View Full Code Here

    }

    protected void runTest() throws Throwable {
        OMFactory factory = metaFactory.getOMFactory();
        // Use same namespace URI but different prefixes
        OMNamespace ns1 = factory.createOMNamespace("urn:ns", "p1");
        OMNamespace ns2 = factory.createOMNamespace("urn:ns", "p2");
        OMElement element = factory.createOMElement(new QName("test"));
        OMAttribute att1 = factory.createOMAttribute("test", ns1, "test");
        OMAttribute att2 = factory.createOMAttribute("test", ns2, "test");
        element.addAttribute(att1);
View Full Code Here

    protected void runTest() throws Throwable {
        OMFactory factory = metaFactory.getOMFactory();
        // Use same namespace URI but different prefixes
        OMNamespace ns1 = factory.createOMNamespace("urn:ns", "p1");
        OMNamespace ns2 = factory.createOMNamespace("urn:ns", "p2");
        OMElement element = factory.createOMElement(new QName("test"));
        OMAttribute att1 = factory.createOMAttribute("test", ns1, "test");
        OMAttribute att2 = factory.createOMAttribute("test", ns2, "test");
        element.addAttribute(att1);
        element.addAttribute(att2);
View Full Code Here

    protected void runTest() throws Throwable {
        OMFactory f = metaFactory.getOMFactory();

        // Create OMSE with a DUMMYPREFIX prefix even though the underlying element uses the default prefix
        OMNamespace rootNS = f.createOMNamespace("http://sampleroot", "rootPrefix");
        OMNamespace ns = f.createOMNamespace("http://DUMMYNS", "DUMMYPREFIX");
        OMElement element =
                f.createOMElement(new TestDataSource(testDocument2), "DUMMYNAME", ns);
        OMElement root = f.createOMElement("root", rootNS);
        root.addChild(element);
View Full Code Here

    protected void runTest() throws Throwable {
        OMFactory f = metaFactory.getOMFactory();

        // Create OMSE with a DUMMYPREFIX prefix even though the underlying element uses the default prefix
        OMNamespace rootNS = f.createOMNamespace("http://sampleroot", "rootPrefix");
        OMNamespace ns = f.createOMNamespace("http://DUMMYNS", "DUMMYPREFIX");
        OMElement element =
                f.createOMElement(new TestDataSource(testDocument2), "DUMMYNAME", ns);
        OMElement root = f.createOMElement("root", rootNS);
        root.addChild(element);
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.