saxon:type
Returns information about the type annotation of a node or atomic value.
type($item as item()?) ➔ function(*)?
Arguments | |||
| $item | item()? | The item whose type information is required |
Result | function(*)? |
Namespace
http://saxon.sf.net/
Saxon availability
Requires Saxon-EE. Implemented since Saxon 9.5.
Details
The information is returned in the same form as information from the saxon:schema() function. That
is, it returns a function item representing the simple or complex type component, whose
properties can be obtained by calling the function. For example,
saxon:type($node)('name')
returns the local name of the type, and
saxon:type($node)('namespace')
returns the corresponding namespace URI.
If it is a simple type, then saxon:type($node)('variety')
might return
list
, in which case saxon:type($node)('itemType')
would
return the item type of the list, again as a function item.
If an empty sequence is supplied, an empty sequence is returned.