Type Errors

If a type cannot be cast to another type, attmpting the cast will generate a type error. Some (perhaps many) of the things you’re used to doing in XPath 1.0 will generate type errors in XPath 2.0:

  • Math operations on strings.

  • Invalid lexical representations (e.g., “12/08/2003” is not a valid lexical form for dates, use “2003-12-08” instead).

  • Incompatible casts.