Interface RecordType

All Superinterfaces:
FunctionItemType, ItemType
All Known Implementing Classes:
RecordTest, SelfReferenceRecordTest

public interface RecordType extends FunctionItemType
An instance of this class represents a specific record type, for example record(x as xs:double, y as element(employee)). Record types were originally introduced as a Saxon extension in Saxon 9.8, under the name "tuple types". They are now in the proposed XPath 4.0 specification. The keyword "tuple" is still supported as a synonym for "record". The syntax for constructing a record type requires Saxon-PE or higher, but the supporting code is included in Saxon-HE for convenience. Extended in 10.0 to distinguish extensible vs non-extensible record types. Extensible record types permit fields other than those listed to appear; non-extensible tuple types do not.
  • Method Details

    • getFieldNames

      Iterable<String> getFieldNames()
      Get the names of all the fields
      Returns:
      the names of the fields (in arbitrary order)
    • getFieldType

      SequenceType getFieldType(String field)
      Get the type of a given field
      Parameters:
      field - the name of the field
      Returns:
      the type of the field if it is defined, or null otherwise
    • isOptionalField

      boolean isOptionalField(String field)
      Ask whether a given field is optional
      Parameters:
      field - the name of the field
      Returns:
      true if the field is defined as an optional field
    • isExtensible

      boolean isExtensible()
      Ask whether the tuple type is extensible, that is, whether fields other than those named are permitted
      Returns:
      true if fields other than the named fields are permitted to appear