use of org.apache.axiom.om.dom.DOMMetaFactory in project webservices-axiom by apache.
the class TestImportNode method runTest.
@Override
protected void runTest() throws Throwable {
Document doc = DOMImplementation.XERCES.parse(new InputSource(file.getUrl().toString()));
Document doc2 = ((DOMMetaFactory) metaFactory).newDocumentBuilderFactory().newDocumentBuilder().newDocument();
Node n = doc2.importNode(doc.getDocumentElement(), true);
assertAbout(xml()).that(xml(OMElement.class, (OMElement) n)).treatingElementContentWhitespaceAsText().hasSameContentAs(xml(Element.class, doc.getDocumentElement()));
}
use of org.apache.axiom.om.dom.DOMMetaFactory in project webservices-axiom by apache.
the class TestDetach method runTest.
@Override
protected void runTest() throws Throwable {
Document document = ((DOMMetaFactory) metaFactory).newDocumentBuilderFactory().newDocumentBuilder().newDocument();
Element parent = document.createElementNS(null, "parent");
Element child = document.createElementNS(null, "child");
parent.appendChild(child);
((OMElement) child).detach();
assertNotSame(document, child.getOwnerDocument());
}
use of org.apache.axiom.om.dom.DOMMetaFactory in project webservices-axiom by apache.
the class TestGetNamespaceNormalized method runTest.
@Override
protected void runTest() throws Throwable {
Document doc = ((DOMMetaFactory) metaFactory).newDocumentBuilderFactory().newDocumentBuilder().newDocument();
Element element = doc.createElementNS(null, "test");
assertNull(((OMElement) element).getNamespace());
}
Aggregations