Saxon.Api

 

 

Saxon.Api

Class XdmItemType

Direct Known Subclasses
XdmAnyArrayType, XdmAnyFunctionType, XdmAnyItemType, XdmAnyMapType, XdmAnyNodeType, XdmAtomicType, XdmNodeKind

public abstract class XdmItemType

Abstract class representing an item type. This may be the generic item type item(), an atomic type, the generic node type node(), a specific node kind such as element() or text(), or the generic function type function().

More specific node types (such as element(E) or schema-element(E)) cannot currently be instantiated directly in this API.

An XdmItemType may however be constructed using the method Processor.ParseItemType()

Method Summary

 bool Matches (XdmItem item)

Determine whether this item type matches a given item.

 bool Subsumes (XdmItemType other)

Determine whether this ItemType subsumes another ItemType. Specifically, A.subsumes(B) is true if every value that matches the ItemType B also matches the ItemType A.

 string ToString ()

Get a string representation of the type. This will be a string that confirms to XPath ItemType production, for example a QName (always in 'Q{uri}local' format, or a construct such as 'node()' or 'map(*)'). If the type is an anonymous schema type, the name of the nearest named base type will be given, preceded by the character '<'

 

Method Detail

Matches

public abstract bool Matches(XdmItem item)

Determine whether this item type matches a given item.

Parameters:

item - the item to be tested against this item type

Returns:

true if the item matches this item type, false if it does not match.

Subsumes

public abstract bool Subsumes(XdmItemType other)

Determine whether this ItemType subsumes another ItemType. Specifically, A.subsumes(B) is true if every value that matches the ItemType B also matches the ItemType A.

Parameters:

other - the other ItemType

Returns:

true if this ItemType subsumes the other ItemType. This includes the case where A and B represent the same ItemType.

ToString

public override string ToString()

Get a string representation of the type. This will be a string that confirms to XPath ItemType production, for example a QName (always in 'Q{uri}local' format, or a construct such as 'node()' or 'map(*)'). If the type is an anonymous schema type, the name of the nearest named base type will be given, preceded by the character '<'

Returns:

a string representation of the type