Package org.apache.axiom.om

Examples of org.apache.axiom.om.OMDocument.serializeAndConsume()


                new StringReader("<elem>text</elem>")).getDocumentElement(true);
        OMDocument document = factory.createOMDocument();
        OMElement root = factory.createOMElement("root", null, document);
        root.addChild(incompleteElement);
        StringWriter out = new StringWriter();
        document.serializeAndConsume(out);
        assertXMLEqual("<root><elem>text</elem></root>", out.toString());
        assertConsumed(incompleteElement);
    }
}
View Full Code Here


                new StringReader("<elem>text</elem>")).getDocumentElement(true);
        OMDocument document = factory.createOMDocument();
        OMElement root = factory.createOMElement("root", null, document);
        root.addChild(incompleteElement);
        StringWriter out = new StringWriter();
        document.serializeAndConsume(out);
        XMLAssert.assertXMLEqual("<root><elem>text</elem></root>", out.toString());
        assertConsumed(incompleteElement);
    }
}
View Full Code Here

    protected void runTest() throws Throwable {
        OMFactory factory = metaFactory.getOMFactory();
        OMDocument document = OMXMLBuilderFactory.createOMBuilder(factory,
                new StringReader("<elem>text</elem>")).getDocument();
        document.serializeAndConsume(new NullOutputStream());
        assertConsumed(document);
    }
}
View Full Code Here

        // TODO: need to get the OMFactory again because for DOOM, it is stateful
        OMDocument document = metaFactory.getOMFactory().createOMDocument();
        OMElement root = factory.createOMElement("root", null, document);
        root.addChild(incompleteElement);
        StringWriter out = new StringWriter();
        document.serializeAndConsume(out);
        XMLAssert.assertXMLEqual("<root><elem>text</elem></root>", out.toString());
        assertConsumed(incompleteElement);
    }
}
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.