Search in sources :

Example 1 with XMLStreamReaderValidator

use of org.apache.axiom.util.stax.debug.XMLStreamReaderValidator in project webservices-axiom by apache.

the class TestGetXMLStreamReaderOnNonRootElementPartiallyBuilt method runTest.

@Override
protected void runTest() throws Throwable {
    OMElement root = AXIOMUtil.stringToOM(metaFactory.getOMFactory(), "<root><child><emptyElement/><element>content</element></child></root>");
    OMElement child = (OMElement) root.getFirstOMChild();
    // Partially build the tree
    if (build > 0) {
        Iterator<OMNode> it = root.getDescendants(false);
        for (int i = 0; i < build; i++) {
            it.next();
        }
    }
    XMLStreamReader reader = new XMLStreamReaderValidator(child.getXMLStreamReader(cache), true);
    while (reader.hasNext()) {
        reader.next();
    }
}
Also used : XMLStreamReaderValidator(org.apache.axiom.util.stax.debug.XMLStreamReaderValidator) OMNode(org.apache.axiom.om.OMNode) XMLStreamReader(javax.xml.stream.XMLStreamReader) OMElement(org.apache.axiom.om.OMElement)

Aggregations

XMLStreamReader (javax.xml.stream.XMLStreamReader)1 OMElement (org.apache.axiom.om.OMElement)1 OMNode (org.apache.axiom.om.OMNode)1 XMLStreamReaderValidator (org.apache.axiom.util.stax.debug.XMLStreamReaderValidator)1