Examples of createOMElement()


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

    protected void runTest() throws Throwable {
        OMFactory factory = metaFactory.getOMFactory();
        OMElement incompleteElement = OMXMLBuilderFactory.createOMBuilder(factory,
                new StringReader("<elem>text</elem>")).getDocumentElement(true);
        OMElement root = factory.createOMElement("root", null);
        assertTrue(root.isComplete());
        root.addChild(incompleteElement);
        assertFalse(root.isComplete());
    }
}
View Full Code Here

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

        super(metaFactory);
    }

    protected void runTest() throws Throwable {
        OMFactory omfactory = metaFactory.getOMFactory();
        OMElement element = omfactory.createOMElement("test", null);
        OMText cdata = omfactory.createOMText("hello world", OMNode.CDATA_SECTION_NODE);
        element.addChild(cdata);
       
        // Get the XMLStreamReader for the element. This will return an OMStAXWrapper.
        XMLStreamReader reader2 = element.getXMLStreamReader();
View Full Code Here

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

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

    protected void runTest() throws Throwable {
        OMFactory factory = metaFactory.getOMFactory();
        OMElement parent = factory.createOMElement("parent", "urn:test", "");
        OMNamespace ns = useNull ? null : factory.createOMNamespace("", "");
        OMElement child = factory.createOMElement("child", ns);
        parent.addChild(child);
        assertNull(child.getNamespace());
    }
View Full Code Here

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

    protected void runTest() throws Throwable {
        OMFactory factory = metaFactory.getOMFactory();
        OMElement parent = factory.createOMElement("parent", "urn:test", "");
        OMNamespace ns = useNull ? null : factory.createOMNamespace("", "");
        OMElement child = factory.createOMElement("child", ns);
        parent.addChild(child);
        assertNull(child.getNamespace());
    }
}
View Full Code Here

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

        super(metaFactory);
    }

    protected void runTest() throws Throwable {
        OMFactory factory = metaFactory.getOMFactory();
        OMElement element1 = factory.createOMElement(new QName("test"));
        OMElement element2 = factory.createOMElement(new QName("test"));
        OMAttribute att1 = element1.addAttribute("test", "test", null);
        OMAttribute att2 = element2.addAttribute(att1);
        assertSame(element1, att1.getOwner());
        assertNotSame(att1, att2);
View Full Code Here

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

    }

    protected void runTest() throws Throwable {
        OMFactory factory = metaFactory.getOMFactory();
        OMElement element1 = factory.createOMElement(new QName("test"));
        OMElement element2 = factory.createOMElement(new QName("test"));
        OMAttribute att1 = element1.addAttribute("test", "test", null);
        OMAttribute att2 = element2.addAttribute(att1);
        assertSame(element1, att1.getOwner());
        assertNotSame(att1, att2);
        assertSame(element2, att2.getOwner());
View Full Code Here

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

        super(metaFactory);
    }

    protected void runTest() throws Throwable {
        OMFactory factory = metaFactory.getOMFactory();
        OMElement element = factory.createOMElement("TestElement", null);
       
        // Add some children of various types
        factory.createOMText(element, "some text");
        factory.createOMText(element, "cdata section", OMNode.CDATA_SECTION_NODE);
        factory.createOMComment(element, "comment");
View Full Code Here

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

        // Add some children of various types
        factory.createOMText(element, "some text");
        factory.createOMText(element, "cdata section", OMNode.CDATA_SECTION_NODE);
        factory.createOMComment(element, "comment");
        factory.createOMProcessingInstruction(element, "piTarget", "piData");
        factory.createOMElement("child", null, element);

        QName qname = new QName("urn:ns1", "test", "ns");
        element.setText(qname);

        assertEquals("ns:test", element.getText());
View Full Code Here

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

        super(metaFactory);
    }

    protected void runTest() throws Throwable {
        OMFactory factory = metaFactory.getOMFactory();
        OMElement element = factory.createOMElement(new QName("urn:ns", "test", "p"));
        assertEquals("p", element.getPrefix());
    }
}
View Full Code Here

Examples of org.apache.axiom.om.impl.dom.factory.OMDOMFactory.createOMElement()

    public void testCreateElement() {
        OMDOMFactory factory = new OMDOMFactory();
        String localName = "TestLocalName";
        String namespace = "http://ws.apache.org/axis2/ns";
        String prefix = "axis2";
        OMElement elem = factory.createOMElement(localName, namespace, prefix);
        QName qname = elem.getQName();

        assertEquals("Localname mismatch", localName, qname.getLocalPart());
        assertEquals("Namespace mismatch", namespace, qname.getNamespaceURI());
        assertEquals("namespace prefix mismatch", prefix, qname.getPrefix());
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.