DOM 3 TypeInfo tells you what the type is 
The Schema object provides  a ValidatorHandler  that implements SAX's ContentHandler interface that you install in a SAX parser.
You also install your own ContentHandler in the ValidatorHandler (not the parser).
The ValidatorHandler makes available a TypeInfoProvider that your ContentHandler can call to determine the type of the current element or one of its attributes.