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(*)

Details

Namespace: http://saxon.sf.net/

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.

Notes on the Saxon implementation

Available since Saxon 9.5

See also:

saxon:schema()