Search code examples
xpathschematron

"instance of" equivalent in Schematron/XPath


I have found that Saxon implementation of XPath 2.0 supports both 'instance of' and 'castable as' as valid ways of obtaining the type of a value, as explained in this website. This seems to be a Saxon specific syntax. Does a standard way of obtaining the type of a node exist?


Solution

  • XPath 2.0 is a W3C recommendation that Saxon implements and the operators instance of and castable as a part of that standard, see https://www.w3.org/TR/xpath20/#id-instance-of and https://www.w3.org/TR/xpath20/#id-castable.