Examples of createOMNamespace()


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

    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(testDocument2), "library", ns);
        OMElement root = f.createOMElement("root", rootNS);
        root.addChild(element);
View Full Code Here

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

        super(metaFactory);
    }

    protected void runTest() throws Throwable {
        OMFactory factory = metaFactory.getOMFactory();
        OMNamespace ns = factory.createOMNamespace("", "");
        OMSourcedElement element = factory.createOMElement(new CharArrayDataSource(
                "<element>content</element>".toCharArray()), "element", ns);
        // This actually returns the "declared" namespace because the sourced element is not
        // expanded yet. Nevertheless the value should have been normalized to null.
        assertNull(element.getNamespace());
View Full Code Here

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("http://DUMMYNS", "DUMMYPREFIX");
        OMElement element =
                f.createOMElement(new TestDataSource(testDocument), "DUMMYNAME", ns);
        OMElement root = f.createOMElement("root", rootNS);
        root.addChild(element);
View Full Code Here

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("http://DUMMYNS", "DUMMYPREFIX");
        OMElement element =
                f.createOMElement(new TestDataSource(testDocument), "DUMMYNAME", ns);
        OMElement root = f.createOMElement("root", rootNS);
        root.addChild(element);
View Full Code Here

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

    protected void runTest() throws Throwable {
        // Create a document with 2 children, each named "sample" but
        // have different namespaces.
        OMFactory factory = metaFactory.getOMFactory();
        OMNamespace a = factory.createOMNamespace(NS_A, "a");
        OMNamespace b = factory.createOMNamespace(NS_B, "b");
       
        OMElement documentElement = factory.createOMElement("Document", a);
        factory.createOMElement("sample", a, documentElement);
        factory.createOMElement("sample", b, documentElement);
View Full Code Here

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

    protected void runTest() throws Throwable {
        // Create a document with 2 children, each named "sample" but
        // have different namespaces.
        OMFactory factory = metaFactory.getOMFactory();
        OMNamespace a = factory.createOMNamespace(NS_A, "a");
        OMNamespace b = factory.createOMNamespace(NS_B, "b");
       
        OMElement documentElement = factory.createOMElement("Document", a);
        factory.createOMElement("sample", a, documentElement);
        factory.createOMElement("sample", b, documentElement);
       
View Full Code Here

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

        env.serialize(writer);
    }

    public void testDualNamespaces1() throws Exception {
        OMFactory factory = OMAbstractFactory.getOMFactory();
        OMNamespace ns1 = factory.createOMNamespace("bar", "x");
        OMNamespace ns2 = factory.createOMNamespace("bar", "y");
        OMElement root = factory.createOMElement("root", ns1);
        OMElement elt11 = factory.createOMElement("foo1", ns1);
        OMElement elt12 = factory.createOMElement("foo2", ns1);
        OMElement elt21 = factory.createOMElement("yuck", ns2);
View Full Code Here

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

    }

    public void testDualNamespaces1() throws Exception {
        OMFactory factory = OMAbstractFactory.getOMFactory();
        OMNamespace ns1 = factory.createOMNamespace("bar", "x");
        OMNamespace ns2 = factory.createOMNamespace("bar", "y");
        OMElement root = factory.createOMElement("root", ns1);
        OMElement elt11 = factory.createOMElement("foo1", ns1);
        OMElement elt12 = factory.createOMElement("foo2", ns1);
        OMElement elt21 = factory.createOMElement("yuck", ns2);
        OMElement elt22 = factory.createOMElement("yuck", ns2);
View Full Code Here

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

        root.serialize(writer);
    }

    public void testDualNamespaces2() throws Exception {
        OMFactory factory = OMAbstractFactory.getOMFactory();
        OMNamespace ns1 = factory.createOMNamespace("bar", "x");
        OMElement root = factory.createOMElement("root", ns1);
        OMNamespace ns2 = root.declareNamespace("bar", "y");
        OMElement elt1 = factory.createOMElement("foo", ns1);
        OMElement elt2 = factory.createOMElement("yuck", ns2);
        OMText txt1 = factory.createOMText(elt2, "blah");
View Full Code Here

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

        assertEquals(addAttributeMethod1(xmlString), addAttributeMethod2(xmlString));
    }

    public void testDefaultAttributeType() throws Exception {
        OMFactory factory = OMAbstractFactory.getOMFactory();
        OMNamespace ns = factory.createOMNamespace("http://www.me.com", "axiom");
        OMAttribute at = factory.createOMAttribute("id", ns, "value");

        assertEquals(at.getAttributeType(), "CDATA");
    }
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.