Package org.apache.axiom.om

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


        assertNull(document.getFirstOMChild());
        // Check that the document is in a clean state and that we are able to add
        // new children.
        document.addChild(factory.createOMElement("newroot", null));
        StringWriter out = new StringWriter();
        document.serialize(out);
        XMLAssert.assertXMLEqual("<newroot/>", out.toString());
    }
}
View Full Code Here


    protected void runTest() throws Throwable {
        OMDocument original = metaFactory.createOMBuilder(metaFactory.getOMFactory(),
                TEST_PARSER_CONFIGURATION, new InputSource(file.getUrl().toString())).getDocument();
        OMDocument clone = (OMDocument)original.clone(new OMCloneOptions());
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        clone.serialize(baos);
        XMLAssertEx.assertXMLIdentical(file.getUrl(),
                new ByteArrayInputStream(baos.toByteArray()), false);
    }
}
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.