rootElement = ((Document)ds.getNode()).getDocumentElement();
} else {
rootElement = (Element)ds.getNode();
}
WoodstoxValidationImpl impl = new WoodstoxValidationImpl();
XMLStreamWriter nullWriter = null;
if (impl.canValidate()) {
nullWriter = StaxUtils.createXMLStreamWriter(new NUllOutputStream());
impl.setupValidation(nullWriter, message.getExchange().getEndpoint(),
message.getExchange().getService().getServiceInfos().get(0));
}
//check if the impl can still validate after the setup, possible issue loading schemas or similar
if (impl.canValidate()) {
//Can use the MSV libs and woodstox to handle the schema validation during
//parsing and processing. Much faster and single traversal
//filter xop node
XMLStreamReader reader = StaxUtils.createXMLStreamReader(ds);
XMLStreamReader filteredReader =