For either the startElement() or endElement() on the XMLDocumentHandler interface you can get the PSVI information.
It is passed via the "augmentations".
For example, we can check the validity PSVI property:
public void endElement(QName qName, Augmentations augmentations) throws XNIException { ElementPSVI psvi = (ElementPSVI)augmentations.getItem("ELEMENT_PSVI"); XSTypeDefinition typedef = psvi.getTypeDefinition(); switch (psvi.getValidity()) { case ItemPSVI.VALIDITY_VALID: System.out.println("Element {"+qName.uri+"}"+qName.localpart+ "\n\tvalid\n\tagainst {"+ typedef.getNamespace()+"}"+typedef.getName()); break; case ItemPSVI.VALIDITY_NOTKNOWN: System.out.println("Element {"+qName.uri+"}"+qName.localpart+ "\n\tvalidity not known."); break; case ItemPSVI.VALIDITY_INVALID: System.out.println("Element {"+qName.uri+"}"+qName.localpart+ "\n\tNOT valid\n\tagainst {"+ typedef.getNamespace()+"}"+typedef.getName()); } }
Keep in mind that validity is only available at the end of the element.