Cast a Document to DocumentAS
Add the schema to the DocumentAS with the
addAS() method.
Invoke DocumentAS's validate method
if (impl.hasFeature("AS-DOC 3.0")) {
Document doc = parser.parseURI("????");
DocumentAS docWithSchema = (DocumentAS) doc;
docWithSchema.addAS(schema);
docWithSchema.validate()
// Process the data...
}