I\'m working with xPath inside Schematron. I\'m able to check that a type is equal to a target type. For example \'xsd:string eq xsd:string\'.
There's no exposed XPath 2.0 functionality for doing this. In fact XPath 2.0 types aren't first-class values; there is no way of finding a type from a name known only at run-time, or asking for properties of the type. You'll need to use extensions: both Xerces and Saxon have APIs for interrogating schema components, and you could construct Java extension functions that invoke these.