Package org.apache.axiom.om

Examples of org.apache.axiom.om.OMSourcedElement.clone()


        OMDataSource ds = new WrappedTextNodeOMDataSourceFromDataSource(new QName("wrapper"),
                new ByteArrayDataSource("test".getBytes("utf-8")), Charset.forName("utf-8"));
        OMSourcedElement element = factory.createOMElement(ds);
        OMCloneOptions options = new OMCloneOptions();
        options.setCopyOMDataSources(copyOMDataSources);
        OMElement clone = (OMElement)element.clone(options);
        if (copyOMDataSources) {
            assertTrue(clone instanceof OMSourcedElement);
            assertFalse(element.isExpanded());
        } else {
            assertFalse(clone instanceof OMSourcedElement);
View Full Code Here


        OMFactory factory = metaFactory.getOMFactory();
        OMDataSource ds = new ByteArrayDataSource("<p:element xmlns:p='urn:ns'>test</p:element>".getBytes("utf-8"), "utf-8");
        OMSourcedElement element = factory.createOMElement(ds);
        OMCloneOptions options = new OMCloneOptions();
        options.setCopyOMDataSources(true);
        OMElement clone = (OMElement)element.clone(options);
        assertTrue(clone instanceof OMSourcedElement);
        assertFalse(element.isExpanded());
        OMNamespace expectedNS = factory.createOMNamespace("urn:ns", "p");
        assertEquals("element", element.getLocalName());
        assertEquals("element", clone.getLocalName());
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.