Saxon.Api

 

 

Saxon.Api

Class XdmNodeKind


public class XdmNodeKind
extends XdmItemType

Instances of XdmNodeKind represent the item types denoted in XPath as document-node(), element(), attribute(), text(), and so on. These are all represented by singular named instances.

Field Summary

static XdmNodeKind Attribute

The item type attribute()

static XdmNodeKind Comment

The item type comment()

static XdmNodeKind Document

The item type document-node()

static XdmNodeKind Element

The item type element()

static XdmNodeKind Namespace

The item type namespace-node()

static XdmNodeKind ProcessingInstruction

The item type processing-instruction()

static XdmNodeKind Text

The item type text()

 

Method Summary

static XdmNodeKind ForNode(XdmNode node)

Get the item type representing the node kind of a supplied node

static XdmNodeKind ForNodeType(XmlNodeType type)

Get the item type corresponding to an XmlNodeType as defined in the System.Xml package

 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.

 

Field Detail

Attribute

public static XdmNodeKind Attribute

The item type attribute()

Comment

public static XdmNodeKind Comment

The item type comment()

Document

public static XdmNodeKind Document

The item type document-node()

Element

public static XdmNodeKind Element

The item type element()

Namespace

public static XdmNodeKind Namespace

The item type namespace-node()

ProcessingInstruction

public static XdmNodeKind ProcessingInstruction

The item type processing-instruction()

Text

public static XdmNodeKind Text

The item type text()

Method Detail

ForNode

public static XdmNodeKind ForNode(XdmNode node)

Get the item type representing the node kind of a supplied node

Parameters:

node - The node whose node kind is required

Returns:

The relevant node kind

ForNodeType

public static XdmNodeKind ForNodeType(XmlNodeType type)

Get the item type corresponding to an XmlNodeType as defined in the System.Xml package

Parameters:

type - The XmlNodeType to be converted

Returns:

The corresponding XdmNodeKind

Matches

public override bool Matches(XdmItem item)

Determine whether this item type matches a given item.

Parameters:

item - 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 override 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.