Casting

if ($x castable as xs:gYear) then 
  $x cast as xs:gYear
else if ($x castable as xs:integer) then 
  $x cast as xs:integer
else if ($x castable as xs:decimal) then 
  $x cast as xs:decimal
else 
  $x cast as string

Previous | Next | Top | Cafe con Leche | Cafe au Lait

Copyright 2002-2008 Elliotte Rusty Harold
elharo@metalab.unc.edu
Last Modified January 19, 2004