Saxon.Api

 

 

Saxon.Api

Class XdmSequenceType


public class XdmSequenceType

An instance of class XdmSequenceType represents a sequence type, that is, the combination of an item type and an occurrence indicator.

An XdmSequenceType may be constructed using the method Processor.ParseSequenceType()

Field Summary

static XdmSequenceType AnySequenceType

A SequenceType that matches any sequence (any kind of item, any length)

 char ONE

Occurrence indicator denoting a sequence of length exactly one

 char ONE_OR_MORE

Occurrence indicator denoting a sequence of any length other than zero (one or more items)

 char ZERO

Occurrence indicator denoting an empty sequence (zero items)

 char ZERO_OR_MORE

Occurrence indicator denoting a sequence of any length (zero or more items)

 char ZERO_OR_ONE

Occurrence indicator denoting a sequence of length zero or one

 

Constructor Summary

XdmSequenceType (XdmItemType itemType, char occurrenceIndicator)

Create an XdmSequenceType corresponding to a given XdmItemType and occurrence indicator

 

Property Summary

 XdmItemType ItemType

The ItemType part of the SequenceType

 char OccurrenceIndicator

The occurrence indicator. One of "?", "*", "+", or " " (single space) meaning exactly 1, or "0" meaning exactly zero.

 

Method Summary

 bool Equals (object obj)

Compare two sequence types for equality

 int GetHashCode ()

Get a hash code to support equality comparison

 bool Matches (XdmValue value)

Ask whether a supplied value is an instance of this SequenceType

 string ToString ()

Get a string representation of the sequence type

 

Field Detail

AnySequenceType

public static readonly XdmSequenceType AnySequenceType

A SequenceType that matches any sequence (any kind of item, any length)

ONE

public char ONE

Occurrence indicator denoting a sequence of length exactly one

ONE_OR_MORE

public char ONE_OR_MORE

Occurrence indicator denoting a sequence of any length other than zero (one or more items)

ZERO

public char ZERO

Occurrence indicator denoting an empty sequence (zero items)

ZERO_OR_MORE

public char ZERO_OR_MORE

Occurrence indicator denoting a sequence of any length (zero or more items)

ZERO_OR_ONE

public char ZERO_OR_ONE

Occurrence indicator denoting a sequence of length zero or one

Constructor Detail

XdmSequenceType

public XdmSequenceType(XdmItemType itemType,
                       char occurrenceIndicator)

Create an XdmSequenceType corresponding to a given XdmItemType and occurrence indicator

Parameters:

itemType - The item type
occurrenceIndicator - The occurrence indicator, one of '?' (zero-or-one), '*' (zero-or-more), '+' (one-or-more), ' ' (a single space) (exactly one), or '0' (exactly zero). The type empty-sequence() can be represented by an occurrence indicator of 'ยบ' with any item type.

Property Detail

ItemType

public XdmItemType ItemType {get; }

The ItemType part of the SequenceType

OccurrenceIndicator

public char OccurrenceIndicator {get; }

The occurrence indicator. One of "?", "*", "+", or " " (single space) meaning exactly 1, or "0" meaning exactly zero.

Method Detail

Equals

public override bool Equals(object obj)

Compare two sequence types for equality

Parameters:

obj - The object to be compared

Returns:

The result of the equality comparison.

GetHashCode

public override int GetHashCode()

Get a hash code to support equality comparison

Returns:

A suitable hash code

Matches

public bool Matches(XdmValue value)

Ask whether a supplied value is an instance of this SequenceType

Parameters:

value - the value to be tested

Returns:

true if the supplied value conforms to this SequenceType

ToString

public override string ToString()

Get a string representation of the sequence type

Returns:

the string representation of the item type, followed by an occurrence indicator