# saxon:type-annotation()

type-annotation(item as item()) ==> xs:QName

This function takes an item as argument.

If the argument is an element or attribute node, the function returns the type annotation of the node, as a QName. If the type is anonymous, this will be a system-generated internal name.

If the argument is a document node, the function returns `xs:anyType` if the document has been schema-validated, or `xs:untyped` otherwise.

For a text node, the function returns `xs:untypedAtomic`, and for comment, processing-instruction, and namespace nodes, it returns `xs:string`.

If the argument is an atomic value, the function returns the type label of the atomic value, again as a QName.

The prefix of the returned QName should not be treated as significant.

Next