1. XML Schema API

Table of contents

1.1. Overview of the XML Schema Interfaces

This module defines a set of objects and interfaces for accessing and querying the post-schema-validation infoset (PSVI) defined in Contributions to the post-schema-validation infoset ([XMLSchema Part 1], Appendix C.2). The interfaces defined in section 1.2 allow developers to access the XML Schema components ([XMLSchema Part 1], Section 3), which follow as a consequence of validation and/or assessment. Section 1.3 defines a set of interfaces for accessing the PSVI from an instance document. Section 1.4 defines a set of interfaces for loading XML Schema documents.

1.1.1. The GenericString type

To ensure interoperability, this specification defines the following:

Type Definition GenericString

A GenericString is a sequence of 16-bit units.


IDL Definition

valuetype GenericString sequence<unsigned short>;

Applications must encode GenericString using UTF-16 (defined in [Unicode 3.0] and Amendment 1 of [ISO/IEC 10646]).

The UTF-16 encoding was chosen because of its widespread use in industry. For XML, the document character set (and therefore the notation of numeric character references) is based on UCS [ISO/IEC 10646]. A single numeric character reference in a source document may therefore in some cases correspond to two 16-bit units in a GenericString (a high surrogate and a low surrogate).

Note: Even though this specification defines the name of the string type to be GenericString, bindings may use different names. For example for Java, GenericString is bound to the String type because it also uses UTF-16 as its encoding.

1.1.2. The GenericObject type

To ensure interoperability, this specification defines the following:

Type Definition GenericObject

A GenericObject represents a reference to an application object.


IDL Definition

typedef Object GenericObject;

Note: Even though this specification uses the type GenericObject, bindings may use different types. For example, in Java and ECMAScript GenericObject is bound to the Object type.

1.1.3. XML Schema Utility interfaces

This section defines the specialized collections framework to retrieve and/or query objects of the types defined in this module.

Interface XSNamedMap

Objects implementing the XSNamedMap interface are used to represent immutable collections of XML Schema components that can be accessed by name. Note that XSNamedMap does not inherit from XSObjectList. The XSObjects in XSNamedMaps are not maintained in any particular order.


IDL Definition
interface XSNamedMap {
  readonly attribute unsigned long   length;
  XSObject           item(in unsigned long index);
  XSObject           itemByName(in GenericString namespace, 
                                in GenericString localName);
};

Attributes
length of type unsigned long, readonly
The number of XSObjects in the XSObjectList. The range of valid child object indices is 0 to length-1 inclusive.
Methods
item
Returns the indexth item in the collection or null if index is greater than or equal to the number of objects in the list. The index starts at 0.
Parameters
index of type unsigned long
index into the collection.
Return Value

XSObject

The XSObject at the indexth position in the XSObjectList, or null if the index specified is not valid.

No Exceptions
itemByName
Retrieves an XSObject specified by local name and namespace URI.
Per [XML Namespaces], applications must use the value null as the namespace parameter for methods if they wish to specify no namespace.
Parameters
namespace of type GenericString
The namespace URI of the XSObject to retrieve, or null if the XSObject has no namespace.
localName of type GenericString
The local name of the XSObject to retrieve.
Return Value

XSObject

A XSObject (of any type) with the specified local name and namespace URI, or null if they do not identify any object in this map.

No Exceptions
Interface XSObjectList

The XSObjectList interface provides the abstraction of an immutable ordered collection of XSObjects, without defining or constraining how this collection is implemented.


IDL Definition
interface XSObjectList {
  readonly attribute unsigned long   length;
  XSObject           item(in unsigned long index);
};

Attributes
length of type unsigned long, readonly
The number of XSObjects in the list. The range of valid child object indices is 0 to length-1 inclusive.
Methods
item
Returns the indexth item in the collection or null if index is greater than or equal to the number of objects in the list. The index starts at 0.
Parameters
index of type unsigned long
index into the collection.
Return Value

XSObject

The XSObject at the indexth position in the XSObjectList, or null if the index specified is not valid.

No Exceptions
Interface XSNamespaceItemList

The XSNamespaceItemList interface provides the abstraction of an immutable ordered collection of XSNamespaceItems, without defining or constraining how this collection is implemented.


IDL Definition
interface XSNamespaceItemList {
  readonly attribute unsigned long   length;
  XSNamespaceItem    item(in unsigned long index);
};

Attributes
length of type unsigned long, readonly
The number of XSNamespaceItems in the list. The range of valid child object indices is 0 to length-1 inclusive.
Methods
item
Returns the indexth item in the collection or null if index is greater than or equal to the number of objects in the list. The index starts at 0.
Parameters
index of type unsigned long
index into the collection.
Return Value

XSNamespaceItem

The XSNamespaceItem at the indexth position in the XSNamespaceItemList, or null if the index specified is not valid.

No Exceptions
Interface StringList

The StringList is an immutable ordered collection of GenericString.


IDL Definition
interface StringList {
  readonly attribute unsigned long   length;
  boolean            contains(in GenericString item);
  GenericString      item(in unsigned long index);
};

Attributes
length of type unsigned long, readonly
The number of GenericStrings in the list. The range of valid child object indices is 0 to length-1 inclusive.
Methods
contains
Checks if the GenericString item is a member of this list.
Parameters
item of type GenericString
GenericString whose presence in this list is to be tested.
Return Value

boolean

True if this list contains the GenericString item.

No Exceptions
item
Returns the indexth item in the collection or null if index is greater than or equal to the number of objects in the list. The index starts at 0.
Parameters
index of type unsigned long
index into the collection.
Return Value

GenericString

The GenericString at the indexth position in the StringList, or null if the index specified is not valid.

No Exceptions
Interface LSInputList

The LSInputList interface provides the abstraction of an ordered collection of LSInputs, without defining or constraining how this collection is implemented.


IDL Definition
interface LSInputList {
  readonly attribute unsigned long   length;
  LSInput           item(in unsigned long index);
};

Attributes
length of type unsigned long, readonly
The number of LSInputs in the list. The range of valid child object indices is 0 to length-1 inclusive.
Methods
item
Returns the indexth item in the collection or null if index is greater than or equal to the number of objects in the list. The index starts at 0.
Parameters
index of type unsigned long
index into the collection.
Return Value

LSInput

The LSInput at the indexth position in the LSInputList, or null if the index specified is not valid.

No Exceptions
Interface ShortList

The ShortList is an immutable ordered collection of unsigned short.


IDL Definition
interface ShortList {
  readonly attribute unsigned long   length;
  boolean            contains(in unsigned short item);
  unsigned short     item(in unsigned long index)
                                        raises(XSException);
};

Attributes
length of type unsigned long, readonly
The number of unsigned shorts in the list. The range of valid child object indices is 0 to length-1 inclusive.
Methods
contains
Checks if the unsigned short item is a member of this list.
Parameters
item of type unsigned short
unsigned short whose presence in this list is to be tested.
Return Value

boolean

True if this list contains the unsigned short item.

No Exceptions
item
Returns the indexth item in the collection. The index starts at 0.
Parameters
index of type unsigned long
index into the collection.
Return Value

unsigned short

The unsigned short at the indexth position in the ShortList.

Exceptions

XSException

INDEX_SIZE_ERR: if index is greater than or equal to the number of objects in the list.

1.2. XML Schema Component API

The interfaces within this section describe the schema components of the XML Schema Recommendation. The description for most schema components is isomorphic to the components that they represent. Some properties or components might not be available if a schema contains errors.

Exception XSException

The XML Schema API operations only raise exceptions in "exceptional" circumstances, i.e., when an operation is impossible to perform (either for logical reasons, because data is lost, or because the implementation has become unstable).

Implementations should raise other exceptions under other circumstances.

Some languages and object systems do not support the concept of exceptions. For such systems, error conditions may be indicated using native error reporting mechanisms. For some bindings, for example, methods may return error codes similar to those listed in the corresponding method descriptions.


IDL Definition
exception XSException {
  unsigned short   code;
};
// ExceptionCode
const unsigned short      NOT_SUPPORTED_ERR              = 1;
const unsigned short      INDEX_SIZE_ERR                 = 2;

Definition group ExceptionCode

An integer indicating the type of error generated.

Defined Constants
INDEX_SIZE_ERR
If index or size is negative, or greater than the allowed value
NOT_SUPPORTED_ERR
If the implementation does not support the requested type of object or operation.
Interface XSObject

The XSObject is a base object for the XML Schema component model.


IDL Definition
interface XSObject {
  readonly attribute unsigned short  type;
  readonly attribute GenericString   name;
  readonly attribute GenericString   namespace;
  readonly attribute XSNamespaceItem namespaceItem;
};

Attributes
name of type GenericString, readonly
The name of type NCName, as defined in XML Namespaces, of this declaration specified in the {name} property of the component or null if the definition of this component does not have a {name} property. For anonymous types, the processor must construct and expose an anonymous type name that is distinct from the name of every named type and the name of every other anonymous type.
namespace of type GenericString, readonly
The [ target namespace] of this object, or null if it is unspecified.
namespaceItem of type XSNamespaceItem, readonly
A namespace schema information item corresponding to the target namespace of the component, if it is globally declared; or null otherwise.
type of type unsigned short, readonly
The type of this object, i.e. ELEMENT_DECLARATION.
Interface XSConstants

This interface defines constants used by this specification.


IDL Definition
interface XSConstants {

  // XML Schema Components
  const unsigned short      ATTRIBUTE_DECLARATION          = 1;
  const unsigned short      ELEMENT_DECLARATION            = 2;
  const unsigned short      TYPE_DEFINITION                = 3;
  const unsigned short      ATTRIBUTE_USE                  = 4;
  const unsigned short      ATTRIBUTE_GROUP                = 5;
  const unsigned short      MODEL_GROUP_DEFINITION         = 6;
  const unsigned short      MODEL_GROUP                    = 7;
  const unsigned short      PARTICLE                       = 8;
  const unsigned short      WILDCARD                       = 9;
  const unsigned short      IDENTITY_CONSTRAINT            = 10;
  const unsigned short      NOTATION_DECLARATION           = 11;
  const unsigned short      ANNOTATION                     = 12;
  const unsigned short      FACET                          = 13;
  const unsigned short      MULTIVALUE_FACET               = 14;


  // Derivation constants
  const unsigned short      DERIVATION_NONE                = 0;
  const unsigned short      DERIVATION_EXTENSION           = 1;
  const unsigned short      DERIVATION_RESTRICTION         = 2;
  const unsigned short      DERIVATION_SUBSTITUTION        = 4;
  const unsigned short      DERIVATION_UNION               = 8;
  const unsigned short      DERIVATION_LIST                = 16;


  // Scope
  const unsigned short      SCOPE_ABSENT                   = 0;
  const unsigned short      SCOPE_GLOBAL                   = 1;
  const unsigned short      SCOPE_LOCAL                    = 2;


  // Value Constraint
  const unsigned short      VC_NONE                        = 0;
  const unsigned short      VC_DEFAULT                     = 1;
  const unsigned short      VC_FIXED                       = 2;


  // Built-in types: primitive and derived
  const unsigned short      ANYSIMPLETYPE_DT               = 1;
  const unsigned short      STRING_DT                      = 2;
  const unsigned short      BOOLEAN_DT                     = 3;
  const unsigned short      DECIMAL_DT                     = 4;
  const unsigned short      FLOAT_DT                       = 5;
  const unsigned short      DOUBLE_DT                      = 6;
  const unsigned short      DURATION_DT                    = 7;
  const unsigned short      DATETIME_DT                    = 8;
  const unsigned short      TIME_DT                        = 9;
  const unsigned short      DATE_DT                        = 10;
  const unsigned short      GYEARMONTH_DT                  = 11;
  const unsigned short      GYEAR_DT                       = 12;
  const unsigned short      GMONTHDAY_DT                   = 13;
  const unsigned short      GDAY_DT                        = 14;
  const unsigned short      GMONTH_DT                      = 15;
  const unsigned short      HEXBINARY_DT                   = 16;
  const unsigned short      BASE64BINARY_DT                = 17;
  const unsigned short      ANYURI_DT                      = 18;
  const unsigned short      QNAME_DT                       = 19;
  const unsigned short      NOTATION_DT                    = 20;
  const unsigned short      NORMALIZEDSTRING_DT            = 21;
  const unsigned short      TOKEN_DT                       = 22;
  const unsigned short      LANGUAGE_DT                    = 23;
  const unsigned short      NMTOKEN_DT                     = 24;
  const unsigned short      NAME_DT                        = 25;
  const unsigned short      NCNAME_DT                      = 26;
  const unsigned short      ID_DT                          = 27;
  const unsigned short      IDREF_DT                       = 28;
  const unsigned short      ENTITY_DT                      = 29;
  const unsigned short      INTEGER_DT                     = 30;
  const unsigned short      NONPOSITIVEINTEGER_DT          = 31;
  const unsigned short      NEGATIVEINTEGER_DT             = 32;
  const unsigned short      LONG_DT                        = 33;
  const unsigned short      INT_DT                         = 34;
  const unsigned short      SHORT_DT                       = 35;
  const unsigned short      BYTE_DT                        = 36;
  const unsigned short      NONNEGATIVEINTEGER_DT          = 37;
  const unsigned short      UNSIGNEDLONG_DT                = 38;
  const unsigned short      UNSIGNEDINT_DT                 = 39;
  const unsigned short      UNSIGNEDSHORT_DT               = 40;
  const unsigned short      UNSIGNEDBYTE_DT                = 41;
  const unsigned short      POSITIVEINTEGER_DT             = 42;
  const unsigned short      LISTOFUNION_DT                 = 43;
  const unsigned short      LIST_DT                        = 44;
  const unsigned short      UNAVAILABLE_DT                 = 45;
};

Definition group XML Schema Components

Types of schema model components.

Defined Constants
ANNOTATION
The object describes an annotation.
ATTRIBUTE_DECLARATION
The object describes an attribute declaration.
ATTRIBUTE_GROUP
The object describes an attribute group definition.
ATTRIBUTE_USE
The object describes an attribute use definition.
ELEMENT_DECLARATION
The object describes an element declaration.
FACET
The object describes a constraining facet. Note: this object does not describe pattern and enumeration facets.
IDENTITY_CONSTRAINT
The object describes an identity constraint definition.
MODEL_GROUP
A model group.
MODEL_GROUP_DEFINITION
The object describes a model group definition.
MULTIVALUE_FACET
The object describes enumeration and pattern facets.
NOTATION_DECLARATION
The object describes a notation declaration.
PARTICLE
The object describes a particle.
TYPE_DEFINITION
The object describes a complex type or simple type definition.
WILDCARD
The object describes a wildcard.
Definition group Derivation constants

This group defines derivation constants for an element declaration and a type definition's final set.

Defined Constants
DERIVATION_EXTENSION
XSTypeDefinition final set or XSElementDeclaration disallowed substitution group.
DERIVATION_LIST
XSTypeDefinition final set.
DERIVATION_NONE
No constraint is available.
DERIVATION_RESTRICTION
XSTypeDefinition final set or XSElementDeclaration disallowed substitution group.
DERIVATION_SUBSTITUTION
XSTypeDefinition final set.
DERIVATION_UNION
XSTypeDefinition final set.
Definition group Scope

The constants that describe a scope.

Defined Constants
SCOPE_ABSENT
The scope of a declaration within named model groups or attribute groups is absent. The scope of such a declaration is determined when it is used in the construction of complex type definitions.
SCOPE_GLOBAL
A scope of global identifies top-level declarations.
SCOPE_LOCAL
Locally scoped declarations are available for use only within the complex type.
Definition group Value Constraint

The constants that describe a value constraint.

Defined Constants
VC_DEFAULT
Indicates that there is a default value constraint.
VC_FIXED
Indicates that there is a fixed value constraint for this attribute.
VC_NONE
Indicates that the component does not have any value constraint.
Definition group Built-in types: primitive and derived

Constants for built-in XML Schema types [XMLSchema Part 2].

Defined Constants
ANYSIMPLETYPE_DT
anySimpleType
ANYURI_DT
anyURI
BASE64BINARY_DT
base64Binary
BOOLEAN_DT
boolean
BYTE_DT
byte
DATETIME_DT
dateTime
DATE_DT
date
DECIMAL_DT
decimal
DOUBLE_DT
double
DURATION_DT
duration
ENTITY_DT
ENTITY
FLOAT_DT
float
GDAY_DT
gDay
GMONTHDAY_DT
gMonthDay
GMONTH_DT
gMonth
GYEARMONTH_DT
gYearMonth
GYEAR_DT
gYear
HEXBINARY_DT
hexBinary
IDREF_DT
IDREF
ID_DT
ID
INTEGER_DT
integer
INT_DT
int
LANGUAGE_DT
language
LISTOFUNION_DT
The type represents a list type definition whose item type ( itemType) is a union type definition
LIST_DT
The type represents a list type definition.
LONG_DT
long
NAME_DT
Name
NCNAME_DT
NCName
NEGATIVEINTEGER_DT
negativeInteger
NMTOKEN_DT
NMTOKEN
NONNEGATIVEINTEGER_DT
nonNegativeInteger
NONPOSITIVEINTEGER_DT
nonPositiveInteger
NORMALIZEDSTRING_DT
normalizedString
NOTATION_DT
NOTATION
POSITIVEINTEGER_DT
positiveInteger
QNAME_DT
QName
SHORT_DT
short
STRING_DT
string
TIME_DT
time
TOKEN_DT
token
UNAVAILABLE_DT
The built-in type category is not available.
UNSIGNEDBYTE_DT
unsignedByte
UNSIGNEDINT_DT
unsignedInt
UNSIGNEDLONG_DT
unsignedLong
UNSIGNEDSHORT_DT
unsignedShort
Interface XSModel

This interface represents an XML Schema.


IDL Definition

Attributes
annotations of type XSObjectList, readonly
[ annotations]: a set of annotations if it exists, otherwise an empty XSObjectList.
namespaceItems of type XSNamespaceItemList, readonly
A set of namespace schema information information items (of type XSNamespaceItem), one for each namespace name which appears as the target namespace of any schema component in the schema used for that assessment, and one for absent if any schema component in the schema had no target namespace. For more information see schema information.
namespaces of type StringList, readonly
Convenience method. Returns a list of all namespaces that belong to this schema. The value null is not a valid namespace name, but if there are components that do not have a target namespace, null is included in this list.
Methods
getAttributeDeclaration
Convenience method. Returns a top-level attribute declaration.
Parameters
namespace of type GenericString
The namespace of the declaration, otherwise null.
name of type GenericString
The name of the declaration.
Return Value

XSAttributeDeclaration

A top-level attribute declaration or null if such a declaration does not exist.

No Exceptions
getAttributeGroup
Convenience method. Returns a top-level attribute group definition.
Parameters
namespace of type GenericString
The namespace of the definition, otherwise null.
name of type GenericString
The name of the definition.
Return Value

XSAttributeGroupDefinition

A top-level attribute group definition or null if such a definition does not exist.

No Exceptions
getComponents
Returns a list of top-level components, i.e. element declarations, attribute declarations, etc.
Parameters
objectType of type unsigned short
The type of the declaration, i.e. ELEMENT_DECLARATION. Note that XSTypeDefinition.SIMPLE_TYPE and XSTypeDefinition.COMPLEX_TYPE can also be used as the objectType to retrieve only complex types or simple types, instead of all types.
Return Value

XSNamedMap

A list of top-level definitions of the specified type in objectType or an empty XSNamedMap if no such definitions exist.

No Exceptions
getComponentsByNamespace
Convenience method. Returns a list of top-level component declarations that are defined within the specified namespace, i.e. element declarations, attribute declarations, etc.
Parameters
objectType of type unsigned short
The type of the declaration, i.e. ELEMENT_DECLARATION.
namespace of type GenericString
The namespace to which the declaration belongs or null (for components with no target namespace).
Return Value

XSNamedMap

A list of top-level definitions of the specified type in objectType and defined in the specified namespace or an empty XSNamedMap.

No Exceptions
getElementDeclaration
Convenience method. Returns a top-level element declaration.
Parameters
namespace of type GenericString
The namespace of the declaration, otherwise null.
name of type GenericString
The name of the declaration.
Return Value

XSElementDeclaration

A top-level element declaration or null if such a declaration does not exist.

No Exceptions
getModelGroupDefinition
Convenience method. Returns a top-level model group definition.
Parameters
namespace of type GenericString
The namespace of the definition, otherwise null.
name of type GenericString
The name of the definition.
Return Value

XSModelGroupDefinition

A top-level model group definition or null if such a definition does not exist.

No Exceptions
getNotationDeclaration
Convenience method. Returns a top-level notation declaration.
Parameters
namespace of type GenericString
The namespace of the declaration, otherwise null.
name of type GenericString
The name of the declaration.
Return Value

XSNotationDeclaration

A top-level notation declaration or null if such a declaration does not exist.

No Exceptions
getTypeDefinition
Convenience method. Returns a top-level simple or complex type definition.
Parameters
namespace of type GenericString
The namespace of the declaration, otherwise null.
name of type GenericString
The name of the definition.
Return Value

XSTypeDefinition

An XSTypeDefinition or null if such a definition does not exist.

No Exceptions
Interface XSNamespaceItem

The interface represents the namespace schema information information item. Each namespace schema information information item corresponds to an XML Schema with a unique namespace name.


IDL Definition

Attributes
annotations of type XSObjectList, readonly
[ annotations]: a set of annotations if it exists, otherwise an empty XSObjectList.
documentLocations of type StringList, readonly
[ document location] - a list of location URIs for the documents that contributed to the XSModel.
schemaNamespace of type GenericString, readonly
[ schema namespace]: A namespace name or null if absent.
Methods
getAttributeDeclaration
Convenience method. Returns a top-level attribute declaration.
Parameters
name of type GenericString
The name of the declaration.
Return Value

XSAttributeDeclaration

A top-level attribute declaration or null if such a declaration does not exist.

No Exceptions
getAttributeGroup
Convenience method. Returns a top-level attribute group definition.
Parameters
name of type GenericString
The name of the definition.
Return Value

XSAttributeGroupDefinition

A top-level attribute group definition or null if such a definition does not exist.

No Exceptions
getComponents
[ schema components]: a list of top-level components, i.e. element declarations, attribute declarations, etc.
Parameters
objectType of type unsigned short
The type of the declaration, i.e. ELEMENT_DECLARATION. Note that XSTypeDefinition.SIMPLE_TYPE and XSTypeDefinition.COMPLEX_TYPE can also be used as the objectType to retrieve only complex types or simple types, instead of all types.
Return Value

XSNamedMap

A list of top-level definition of the specified type in objectType or an empty XSNamedMap if no such definitions exist.

No Exceptions
getElementDeclaration
Convenience method. Returns a top-level element declaration.
Parameters
name of type GenericString
The name of the declaration.
Return Value

XSElementDeclaration

A top-level element declaration or null if such a declaration does not exist.

No Exceptions
getModelGroupDefinition
Convenience method. Returns a top-level model group definition.
Parameters
name of type GenericString
The name of the definition.
Return Value

XSModelGroupDefinition

A top-level model group definition definition or null if such a definition does not exist.

No Exceptions
getNotationDeclaration
Convenience method. Returns a top-level notation declaration.
Parameters
name of type GenericString
The name of the declaration.
Return Value

XSNotationDeclaration

A top-level notation declaration or null if such a declaration does not exist.

No Exceptions
getTypeDefinition
Convenience method. Returns a top-level simple or complex type definition.
Parameters
name of type GenericString
The name of the definition.
Return Value

XSTypeDefinition

An XSTypeDefinition or null if such a definition does not exist.

No Exceptions
Interface XSAttributeDeclaration

The interface represents the Attribute Declaration schema component.


IDL Definition
interface XSAttributeDeclaration : XSObject {
  readonly attribute XSSimpleTypeDefinition typeDefinition;
  readonly attribute unsigned short  scope;
  readonly attribute XSComplexTypeDefinition enclosingCTDefinition;
  readonly attribute unsigned short  constraintType;
  readonly attribute GenericString   constraintValue;
  readonly attribute GenericObject   actualVC;
                                        // raises(XSException) on retrieval

  readonly attribute unsigned short  actualVCType;
                                        // raises(XSException) on retrieval

  readonly attribute ShortList       itemValueTypes;
                                        // raises(XSException) on retrieval

  readonly attribute XSAnnotation    annotation;
};

Attributes
actualVC of type GenericObject, readonly
Value Constraint: Binding specific actual constraint value or null if the value is in error or there is no value constraint.
Exceptions on retrieval

XSException

NOT_SUPPORTED_ERR: Raised if the implementation does not support this method.

actualVCType of type unsigned short, readonly
The actual constraint value built-in datatype, e.g. STRING_DT, SHORT_DT. If the type definition of this value is a list type definition, this method returns LIST_DT. If the type definition of this value is a list type definition whose item type is a union type definition, this method returns LISTOFUNION_DT. To query the actual constraint value of the list or list of union type definitions use itemValueTypes. If the actualValue is null, this method returns UNAVAILABLE_DT.
Exceptions on retrieval

XSException

NOT_SUPPORTED_ERR: Raised if the implementation does not support this method.

annotation of type XSAnnotation, readonly
An annotation if it exists, otherwise null.
constraintType of type unsigned short, readonly
Value constraint: one of VC_NONE, VC_DEFAULT, VC_FIXED.
constraintValue of type GenericString, readonly
Value constraint: The constraint value with respect to the [ type definition], otherwise null.
enclosingCTDefinition of type XSComplexTypeDefinition, readonly
The complex type definition for locally scoped declarations (see scope), otherwise null if no such definition exists.
itemValueTypes of type ShortList, readonly
In the case the actual constraint value represents a list, i.e. the actualValueType is LIST_DT, the returned array consists of one type kind which represents the itemType. If the actual constraint value represents a list type definition whose item type is a union type definition, i.e. LISTOFUNION_DT, for each actual constraint value in the list the array contains the corresponding memberType kind. For examples, see ItemPSVI.itemValueTypes.
Exceptions on retrieval

XSException

NOT_SUPPORTED_ERR: Raised if the implementation does not support this method.

scope of type unsigned short, readonly
[ scope]. One of SCOPE_GLOBAL, SCOPE_LOCAL, or SCOPE_ABSENT. If the scope is local, then the enclosingCTDefinition is present.
typeDefinition of type XSSimpleTypeDefinition, readonly
[ type definition]: A simple type definition.
Interface XSElementDeclaration

The interface represents the Element Declaration schema component.


IDL Definition
interface XSElementDeclaration : XSTerm {
  readonly attribute XSTypeDefinition typeDefinition;
  readonly attribute unsigned short  scope;
  readonly attribute XSComplexTypeDefinition enclosingCTDefinition;
  readonly attribute unsigned short  constraintType;
  readonly attribute GenericString   constraintValue;
  readonly attribute GenericObject   actualVC;
                                        // raises(XSException) on retrieval

  readonly attribute unsigned short  actualVCType;
                                        // raises(XSException) on retrieval

  readonly attribute ShortList       itemValueTypes;
                                        // raises(XSException) on retrieval

  readonly attribute boolean         nillable;
  readonly attribute XSNamedMap      identityConstraints;
  readonly attribute XSElementDeclaration substitutionGroupAffiliation;
  boolean            isSubstitutionGroupExclusion(in unsigned short exclusion);
  readonly attribute unsigned short  substitutionGroupExclusions;
  boolean            isDisallowedSubstitution(in unsigned short disallowed);
  readonly attribute unsigned short  disallowedSubstitutions;
  readonly attribute boolean         abstract;
  readonly attribute XSAnnotation    annotation;
};

Attributes
abstract of type boolean, readonly
{abstract} A boolean.
actualVC of type GenericObject, readonly
Value Constraint: Binding specific actual constraint value or null if the value is in error or there is no value constraint.
Exceptions on retrieval

XSException

NOT_SUPPORTED_ERR: Raised if the implementation does not support this method.

actualVCType of type unsigned short, readonly
The actual constraint value built-in datatype, e.g. STRING_DT, SHORT_DT. If the type definition of this value is a list type definition, this method returns LIST_DT. If the type definition of this value is a list type definition whose item type is a union type definition, this method returns LISTOFUNION_DT. To query the actual constraint value of the list or list of union type definitions use itemValueTypes. If the actualNormalizedValue is null, this method returns UNAVAILABLE_DT.
Exceptions on retrieval

XSException

NOT_SUPPORTED_ERR: Raised if the implementation does not support this method.

annotation of type XSAnnotation, readonly
An annotation if it exists, otherwise null.
constraintType of type unsigned short, readonly
[ Value constraint]: one of VC_NONE, VC_DEFAULT, VC_FIXED.
constraintValue of type GenericString, readonly
[ Value constraint]: the constraint value with respect to the [ type definition], otherwise null.
disallowedSubstitutions of type unsigned short, readonly
[ disallowed substitutions]: the returned value is a bit combination of the subset of {DERIVATION_SUBSTITUTION, DERIVATION_EXTENSION, DERIVATION_RESTRICTION} corresponding to substitutions disallowed by this XSElementDeclaration or DERIVATION_NONE.
enclosingCTDefinition of type XSComplexTypeDefinition, readonly
The complex type definition for locally scoped declarations (see scope), otherwise null if no such definition exists.
identityConstraints of type XSNamedMap, readonly
identity-constraint definitions: a set of constraint definitions if it exists, otherwise an empty XSNamedMap.
itemValueTypes of type ShortList, readonly
In the case the actual constraint value represents a list, i.e. the actualValueType is LIST_DT, the returned array consists of one type kind which represents the itemType. If the actual constraint value represents a list type definition whose item type is a union type definition, i.e. LISTOFUNION_DT, for each actual constraint value in the list the array contains the corresponding memberType kind. For examples, see ItemPSVI.itemValueTypes.
Exceptions on retrieval

XSException

NOT_SUPPORTED_ERR: Raised if the implementation does not support this method.

nillable of type boolean, readonly
If nillable is true, then an element may also be valid if it carries the namespace qualified attribute with local name nil from namespace http://www.w3.org/2001/XMLSchema-instance and value true ( xsi:nil) even if it has no text or element content despite a content type which would otherwise require content.
scope of type unsigned short, readonly
[ scope]. One of SCOPE_GLOBAL, SCOPE_LOCAL, or SCOPE_ABSENT. If the scope is local, then the enclosingCTDefinition is present.
substitutionGroupAffiliation of type XSElementDeclaration, readonly
[ substitution group affiliation]: a top-level element definition if it exists, otherwise null.
substitutionGroupExclusions of type unsigned short, readonly
[ substitution group exclusions]: the returned value is a bit combination of the subset of {DERIVATION_EXTENSION, DERIVATION_RESTRICTION} or DERIVATION_NONE.
typeDefinition of type XSTypeDefinition, readonly
[ type definition]: either a simple type definition or a complex type definition.
Methods
isDisallowedSubstitution
Convenience method that checks if disallowed is a disallowed substitution for this element declaration.
Parameters
disallowed of type unsigned short
{DERIVATION_SUBSTITUTION, DERIVATION_EXTENSION, DERIVATION_RESTRICTION} or DERIVATION_NONE. Represents a block set for the element.
Return Value

boolean

True if disallowed is a part of the substitution group exclusion subset.

No Exceptions
isSubstitutionGroupExclusion
Convenience method that checks if exclusion is a substitution group exclusion for this element declaration.
Parameters
exclusion of type unsigned short
DERIVATION_EXTENSION, DERIVATION_RESTRICTION or DERIVATION_NONE. Represents final set for the element.
Return Value

boolean

True if exclusion is a part of the substitution group exclusion subset.

No Exceptions
Interface XSTypeDefinition

This interface represents a complex or simple type definition.


IDL Definition
interface XSTypeDefinition : XSObject {
  const unsigned short      COMPLEX_TYPE                   = 15;
  const unsigned short      SIMPLE_TYPE                    = 16;
  readonly attribute unsigned short  typeCategory;
  readonly attribute XSTypeDefinition baseType;
  boolean            isFinal(in unsigned short restriction);
  readonly attribute unsigned short  final;
  readonly attribute boolean         anonymous;
  boolean            derivedFromType(in XSTypeDefinition ancestorType, 
                                     in unsigned short derivationMethod);
  boolean            derivedFrom(in GenericString namespace, 
                                 in GenericString name, 
                                 in unsigned short derivationMethod);
};

Constant COMPLEX_TYPE
The object describes a complex type.
Constant SIMPLE_TYPE
The object describes a simple type.
Attributes
anonymous of type boolean, readonly
Convenience attribute. A boolean that specifies if the type definition is anonymous.
baseType of type XSTypeDefinition, readonly
{base type definition}: either a simple type definition or a complex type definition.
final of type unsigned short, readonly
For complex types the returned value is a bit combination of the subset of {DERIVATION_EXTENSION, DERIVATION_RESTRICTION} corresponding to final set of this type or DERIVATION_NONE. For simple types the returned value is a bit combination of the subset of { DERIVATION_RESTRICTION, DERIVATION_EXTENSION, DERIVATION_UNION, DERIVATION_LIST} corresponding to final set of this type or DERIVATION_NONE.
typeCategory of type unsigned short, readonly
Return whether this type definition is a simple type or complex type.
Methods
derivedFrom
Convenience method which checks if this type is derived from the given ancestor type.
Parameters
namespace of type GenericString
An ancestor type namespace.
name of type GenericString
An ancestor type name.
derivationMethod of type unsigned short
A bit combination representing a subset of {DERIVATION_RESTRICTION, DERIVATION_EXTENSION, DERIVATION_UNION, DERIVATION_LIST}.
Return Value

boolean

True if this type is derived from ancestorType using only derivation methods from the derivationMethod.

No Exceptions
derivedFromType
Convenience method which checks if this type is derived from the given ancestorType.
Parameters
ancestorType of type XSTypeDefinition
An ancestor type definition.
derivationMethod of type unsigned short
A bit combination representing a subset of {DERIVATION_RESTRICTION, DERIVATION_EXTENSION, DERIVATION_UNION, DERIVATION_LIST}.
Return Value

boolean

True if this type is derived from ancestorType using only derivation methods from the derivationMethod.

No Exceptions
isFinal
{final}. For a complex type definition it is a subset of {extension, restriction}. For a simple type definition it is a subset of {extension, list, restriction, union}.
Parameters
restriction of type unsigned short
Extension, restriction, list, union constants (defined in XSConstants).
Return Value

boolean

True if restriction is in the final set, otherwise false.

No Exceptions
Interface XSComplexTypeDefinition

This interface represents the Complex Type Definition schema component.


IDL Definition
interface XSComplexTypeDefinition : XSTypeDefinition {

  // Content Model Types
  const unsigned short      CONTENTTYPE_EMPTY              = 0;
  const unsigned short      CONTENTTYPE_SIMPLE             = 1;
  const unsigned short      CONTENTTYPE_ELEMENT            = 2;
  const unsigned short      CONTENTTYPE_MIXED              = 3;

  readonly attribute unsigned short  derivationMethod;
  readonly attribute boolean         abstract;
  readonly attribute XSObjectList    attributeUses;
  readonly attribute XSWildcard      attributeWildcard;
  readonly attribute unsigned short  contentType;
  readonly attribute XSSimpleTypeDefinition simpleType;
  readonly attribute XSParticle      particle;
  boolean            isProhibitedSubstitution(in unsigned short restriction);
  readonly attribute unsigned short  prohibitedSubstitutions;
  readonly attribute XSObjectList    annotations;
};

Definition group Content Model Types

A code representing the type of a content model.

Defined Constants
CONTENTTYPE_ELEMENT
Represents an element-only content type. An element-only content type validates elements with children that conform to the supplied content model.
CONTENTTYPE_EMPTY
Represents an empty content type. A content type with the distinguished value empty validates elements with no character or element information item children.
CONTENTTYPE_MIXED
Represents a mixed content type.
CONTENTTYPE_SIMPLE
Represents a simple content type. A content type which is simple validates elements with character-only children.
Attributes
abstract of type boolean, readonly
[ abstract]: a boolean. Complex types for which abstract is true must not be used as the type definition for the validation of element information items.
annotations of type XSObjectList, readonly
A set of [ annotations] if it exists, otherwise an empty XSObjectList.
attributeUses of type XSObjectList, readonly
A set of attribute uses if it exists, otherwise an empty XSObjectList.
attributeWildcard of type XSWildcard, readonly
An attribute wildcard if it exists, otherwise null.
contentType of type unsigned short, readonly
[ content type]: one of empty (CONTENTTYPE_EMPTY), a simple type definition (CONTENTTYPE_SIMPLE), mixed (CONTENTTYPE_MIXED), or element-only (CONTENTTYPE_ELEMENT).
derivationMethod of type unsigned short, readonly
[ derivation method]: either DERIVATION_EXTENSION, DERIVATION_RESTRICTION, or DERIVATION_NONE (see XSConstants).
particle of type XSParticle, readonly
A particle for a mixed or element-only content model, otherwise null.
prohibitedSubstitutions of type unsigned short, readonly
[ prohibited substitutions]: A subset of {extension, restriction} or DERIVATION_NONE represented as a bit flag (see XSConstants).
simpleType of type XSSimpleTypeDefinition, readonly
A simple type definition corresponding to a simple content model, otherwise null.
Methods
isProhibitedSubstitution
[ prohibited substitutions]: a subset of {extension, restriction}
Parameters
restriction of type unsigned short
Extension or restriction constants (see XSConstants).
Return Value

boolean

True if restriction is a prohibited substitution, otherwise false.

No Exceptions
Interface XSSimpleTypeDefinition

This interface represents the Simple Type Definition schema component. This interface provides several query operations for facet components. Users can either retrieve the defined facets as XML Schema components, using the facets and the multiValueFacets attributes; or users can separately query a facet's properties using methods such as getLexicalFacetValue, isFixedFacet, etc.


IDL Definition
interface XSSimpleTypeDefinition : XSTypeDefinition {

  // Variety definitions
  const unsigned short      VARIETY_ABSENT                 = 0;
  const unsigned short      VARIETY_ATOMIC                 = 1;
  const unsigned short      VARIETY_LIST                   = 2;
  const unsigned short      VARIETY_UNION                  = 3;


  // Facets
  const unsigned short      FACET_NONE                     = 0;
  const unsigned short      FACET_LENGTH                   = 1;
  const unsigned short      FACET_MINLENGTH                = 2;
  const unsigned short      FACET_MAXLENGTH                = 4;
  const unsigned short      FACET_PATTERN                  = 8;
  const unsigned short      FACET_WHITESPACE               = 16;
  const unsigned short      FACET_MAXINCLUSIVE             = 32;
  const unsigned short      FACET_MAXEXCLUSIVE             = 64;
  const unsigned short      FACET_MINEXCLUSIVE             = 128;
  const unsigned short      FACET_MININCLUSIVE             = 256;
  const unsigned short      FACET_TOTALDIGITS              = 512;
  const unsigned short      FACET_FRACTIONDIGITS           = 1024;
  const unsigned short      FACET_ENUMERATION              = 2048;

  const unsigned short      ORDERED_FALSE                  = 0;
  const unsigned short      ORDERED_PARTIAL                = 1;
  const unsigned short      ORDERED_TOTAL                  = 2;
  readonly attribute unsigned short  variety;
  readonly attribute XSSimpleTypeDefinition primitiveType;
  readonly attribute unsigned short  builtInKind;
  readonly attribute XSSimpleTypeDefinition itemType;
  readonly attribute XSObjectList    memberTypes;
  readonly attribute unsigned short  definedFacets;
  boolean            isDefinedFacet(in unsigned short facetName);
  readonly attribute unsigned short  fixedFacets;
  boolean            isFixedFacet(in unsigned short facetName);
  GenericString      getLexicalFacetValue(in unsigned short facetName);
  readonly attribute StringList      lexicalEnumeration;
  readonly attribute StringList      lexicalPattern;
  readonly attribute unsigned short  ordered;
  readonly attribute boolean         finite;
  readonly attribute boolean         bounded;
  readonly attribute boolean         numeric;
  readonly attribute XSObjectList    facets;
  readonly attribute XSObjectList    multiValueFacets;
  readonly attribute XSObjectList    annotations;
};

Definition group Variety definitions

Variety constants.

Defined Constants
VARIETY_ABSENT
The variety is absent for the anySimpleType definition.
VARIETY_ATOMIC
Atomic type.
VARIETY_LIST
List type.
VARIETY_UNION
Union type.
Definition group Facets

The names of constraining facets 4.3 Constraining Facets and enumeration constants.

Defined Constants
FACET_ENUMERATION
4.3.5 enumeration.
FACET_FRACTIONDIGITS
4.3.12 fractionDigits.
FACET_LENGTH
4.3.1 Length
FACET_MAXEXCLUSIVE
4.3.9 maxExclusive.
FACET_MAXINCLUSIVE
4.3.7 maxInclusive.
FACET_MAXLENGTH
4.3.3 maxLength.
FACET_MINEXCLUSIVE
4.3.9 minExclusive.
FACET_MININCLUSIVE
4.3.10 minInclusive.
FACET_MINLENGTH
4.3.2 minLength.
FACET_NONE
No facets defined.
FACET_PATTERN
4.3.4 pattern.
FACET_TOTALDIGITS
4.3.11 totalDigits .
FACET_WHITESPACE
4.3.5 whitespace.
Constant ORDERED_FALSE
A constant defined for the 'ordered' fundamental facet: not ordered.
Constant ORDERED_PARTIAL
A constant defined for the 'ordered' fundamental facet: partially ordered.
Constant ORDERED_TOTAL
A constant defined for the 'ordered' fundamental facet: total ordered.
Attributes
annotations of type XSObjectList, readonly
[ annotations]: a set of annotations for this simple type component if it exists, otherwise an empty XSObjectList.
bounded of type boolean, readonly
Fundamental Facet: bounded.
builtInKind of type unsigned short, readonly
Returns the closest built-in type category this type represents or derived from. For example, if this simple type is a built-in derived type integer the INTEGER_DV is returned.
definedFacets of type unsigned short, readonly
[ facets]: all facets defined on this type. The value is a bit combination of FACET_XXX constants of all defined facets.
facets of type XSObjectList, readonly
A list of constraining facets if it exists, otherwise an empty XSObjectList. Note: This method must not be used to retrieve values for enumeration and pattern facets.
finite of type boolean, readonly
Fundamental Facet: cardinality.
fixedFacets of type unsigned short, readonly
[ facets]: all defined facets for this type which are fixed.
itemType of type XSSimpleTypeDefinition, readonly
If variety is list the item type definition (an atomic or union simple type definition) is available, otherwise null.
lexicalEnumeration of type StringList, readonly
A list of enumeration values if it exists, otherwise an empty StringList.
lexicalPattern of type StringList, readonly
A list of pattern values if it exists, otherwise an empty StringList.
memberTypes of type XSObjectList, readonly
If variety is union the list of member type definitions (a non-empty sequence of simple type definitions) is available, otherwise an empty XSObjectList.
multiValueFacets of type XSObjectList, readonly
A list of enumeration and pattern constraining facets if it exists, otherwise an empty XSObjectList.
numeric of type boolean, readonly
Fundamental Facet: numeric.
ordered of type unsigned short, readonly
Fundamental Facet: ordered.
primitiveType of type XSSimpleTypeDefinition, readonly
If variety is atomic the primitive type definition (a built-in primitive datatype definition or the simple ur-type definition) is available, otherwise null.
variety of type unsigned short, readonly
[ variety]: one of {atomic, list, union} or absent.
Methods
getLexicalFacetValue
Convenience method. Returns a value of a single constraining facet for this simple type definition. This method must not be used to retrieve values for enumeration and pattern facets.
Parameters
facetName of type unsigned short
The name of the facet, i.e. FACET_LENGTH, FACET_TOTALDIGITS (see XSConstants). To retrieve the value for a pattern or an enumeration, see enumeration and pattern.
Return Value

GenericString

A value of the facet specified in facetName for this simple type definition or null.

No Exceptions
isDefinedFacet
Convenience method. [ Facets]: check whether a facet is defined on this type.
Parameters
facetName of type unsigned short
The name of the facet.
Return Value

boolean

True if the facet is defined, false otherwise.

No Exceptions
isFixedFacet
Convenience method. [ Facets]: check whether a facet is defined and fixed on this type.
Parameters
facetName of type unsigned short
The name of the facet.
Return Value

boolean

True if the facet is fixed, false otherwise.

No Exceptions
Interface XSFacet

Describes a constraining facet. Enumeration and pattern facets are exposed via XSMultiValueFacet interface.


IDL Definition
interface XSFacet : XSObject {
  readonly attribute unsigned short  facetKind;
  readonly attribute GenericString   lexicalFacetValue;
  readonly attribute boolean         fixed;
  readonly attribute XSAnnotation    annotation;
};

Attributes
annotation of type XSAnnotation, readonly
An annotation if it exists, otherwise null.
facetKind of type unsigned short, readonly
The name of the facet, e.g. FACET_LENGTH, FACET_TOTALDIGITS (see XSConstants).
fixed of type boolean, readonly
[ Facets]: check whether a facet is fixed.
lexicalFacetValue of type GenericString, readonly
A value of this facet.
Interface XSMultiValueFacet

Describes a multi-value constraining facets: pattern and enumeration.


IDL Definition
interface XSMultiValueFacet : XSObject {
  readonly attribute unsigned short  facetKind;
  readonly attribute StringList      lexicalFacetValues;
  readonly attribute XSObjectList    annotations;
};

Attributes
annotations of type XSObjectList, readonly
A set of [ annotations] if it exists, otherwise an empty XSObjectList.
facetKind of type unsigned short, readonly
The name of the facet, i.e. FACET_ENUMERATION and FACET_PATTERN (see XSConstants).
lexicalFacetValues of type StringList, readonly
Values of this facet.
Interface XSParticle

This interface represents the Particle schema component.


IDL Definition
interface XSParticle : XSObject {
  readonly attribute unsigned long   minOccurs;
  readonly attribute unsigned long   maxOccurs;
  readonly attribute boolean         maxOccursUnbounded;
  readonly attribute XSTerm          term;
};

Attributes
maxOccurs of type unsigned long, readonly
[ max occurs]: determines the maximum number of terms that can occur. To query for the value of unbounded use maxOccursUnbounded. When the value of maxOccursUnbounded is true, the value of maxOccurs is unspecified.
maxOccursUnbounded of type boolean, readonly
[ max occurs]: whether the maxOccurs value is unbounded.
minOccurs of type unsigned long, readonly
[ min occurs]: determines the minimum number of terms that can occur.
term of type XSTerm, readonly
[ term]: one of a model group, a wildcard, or an element declaration.
Interface XSTerm

Describes a term that can be one of a model group, a wildcard, or an element declaration. Objects implementing XSElementDeclaration, XSModelGroup and XSWildcard interfaces also implement this interface.


IDL Definition
interface XSTerm : XSObject {
};

Interface XSModelGroup

This interface represents the Model Group schema component.


IDL Definition
interface XSModelGroup : XSTerm {

  // Content model compositors
  const unsigned short      COMPOSITOR_SEQUENCE            = 1;
  const unsigned short      COMPOSITOR_CHOICE              = 2;
  const unsigned short      COMPOSITOR_ALL                 = 3;

  readonly attribute unsigned short  compositor;
  readonly attribute XSObjectList    particles;
  readonly attribute XSAnnotation    annotation;
};

Definition group Content model compositors

List of content model compositors.

Defined Constants
COMPOSITOR_ALL
This content model represents a simplified version of the SGML &-Connector and is limited to the top-level of any content model. No element in the all content model may appear more than once.
COMPOSITOR_CHOICE
This constant value signifies a choice operator.
COMPOSITOR_SEQUENCE
This constant value signifies a sequence operator.
Attributes
annotation of type XSAnnotation, readonly
An [ annotation] if it exists, otherwise null.
compositor of type unsigned short, readonly
[ compositor]: one of all, choice or sequence. The valid constant values are: COMPOSITOR_SEQUENCE, COMPOSITOR_CHOICE, COMPOSITOR_ALL.
particles of type XSObjectList, readonly
A list of [ particles] if it exists, otherwise an empty XSObjectList.
Interface XSModelGroupDefinition

This interface represents the Model Group Definition schema component.


IDL Definition
interface XSModelGroupDefinition : XSObject {
  readonly attribute XSModelGroup    modelGroup;
  readonly attribute XSAnnotation    annotation;
};

Attributes
annotation of type XSAnnotation, readonly
An [ annotation] if it exists, otherwise null.
modelGroup of type XSModelGroup, readonly
A model group.
Interface XSAttributeGroupDefinition

This interface represents the Attribute Group Definition schema component.


IDL Definition
interface XSAttributeGroupDefinition : XSObject {
  readonly attribute XSObjectList    attributeUses;
  readonly attribute XSWildcard      attributeWildcard;
  readonly attribute XSAnnotation    annotation;
};

Attributes
annotation of type XSAnnotation, readonly
An [ annotation] if it exists, otherwise null.
attributeUses of type XSObjectList, readonly
A set of [ attribute uses] if it exists, otherwise an empty XSObjectList.
attributeWildcard of type XSWildcard, readonly
A [ wildcard] if it exists, otherwise null.
Interface XSAttributeUse

This interface represents the Attribute Use schema component.


IDL Definition
interface XSAttributeUse : XSObject {
  readonly attribute boolean         required;
  readonly attribute XSAttributeDeclaration attrDeclaration;
  readonly attribute unsigned short  constraintType;
  readonly attribute GenericString   constraintValue;
  readonly attribute GenericObject   actualVC;
                                        // raises(XSException) on retrieval

  readonly attribute unsigned short  actualVCType;
                                        // raises(XSException) on retrieval

  readonly attribute ShortList       itemValueTypes;
                                        // raises(XSException) on retrieval

};

Attributes
actualVC of type GenericObject, readonly
Value Constraint: Binding specific actual constraint value or null if the value is in error or there is no value constraint.
Exceptions on retrieval

XSException

NOT_SUPPORTED_ERR: Raised if the implementation does not support this method.

actualVCType of type unsigned short, readonly
The actual constraint value built-in datatype, e.g. STRING_DT, SHORT_DT. If the type definition of this value is a list type definition, this method returns LIST_DT. If the type definition of this value is a list type definition whose item type is a union type definition, this method returns LISTOFUNION_DT. To query the actual constraint value of the list or list of union type definitions use itemValueTypes. If the actualNormalizedValue is null, this method returns UNAVAILABLE_DT.
Exceptions on retrieval

XSException

NOT_SUPPORTED_ERR: Raised if the implementation does not support this method.

attrDeclaration of type XSAttributeDeclaration, readonly
[ attribute declaration]: provides the attribute declaration itself, which will in turn determine the simple type definition used.
constraintType of type unsigned short, readonly
Value Constraint: one of default, fixed.
constraintValue of type GenericString, readonly
Value Constraint: The constraint value, otherwise null.
itemValueTypes of type ShortList, readonly
In the case the actual constraint value represents a list, i.e. the actualValueType is LIST_DT, the returned array consists of one type kind which represents the itemType. If the actual constraint value represents a list type definition whose item type is a union type definition, i.e. LISTOFUNION_DT, for each actual constraint value in the list the array contains the corresponding memberType kind. For examples, see ItemPSVI.itemValueTypes.
Exceptions on retrieval

XSException

NOT_SUPPORTED_ERR: Raised if the implementation does not support this method.

required of type boolean, readonly
[ required]: determines whether this use of an attribute declaration requires an appropriate attribute information item to be present, or merely allows it.
Interface XSWildcard

This interface represents the Wildcard schema component.


IDL Definition
interface XSWildcard : XSTerm {

  // Namespace Constraint
  const unsigned short      NSCONSTRAINT_ANY               = 1;
  const unsigned short      NSCONSTRAINT_NOT               = 2;
  const unsigned short      NSCONSTRAINT_LIST              = 3;


  // Process contents
  const unsigned short      PC_STRICT                      = 1;
  const unsigned short      PC_SKIP                        = 2;
  const unsigned short      PC_LAX                         = 3;

  readonly attribute unsigned short  constraintType;
  readonly attribute StringList      nsConstraintList;
  readonly attribute unsigned short  processContents;
  readonly attribute XSAnnotation    annotation;
};

Definition group Namespace Constraint

The constants that describe a type of namespace constraint.

Defined Constants
NSCONSTRAINT_ANY
Namespace Constraint: any namespace is allowed.
NSCONSTRAINT_LIST
Namespace Constraint: namespaces in the list are allowed.
NSCONSTRAINT_NOT
Namespace Constraint: namespaces in the list are not allowed.
Definition group Process contents
Defined Constants
PC_LAX
If the item, or any items among its [children] is an element information item, has a uniquely determined declaration available, it must be valid with respect to that definition, that is, validate where you can and do not worry when you cannot.
PC_SKIP
No constraints at all: the item must simply be well-formed XML.
PC_STRICT
There must be a top-level declaration for the item available, or the item must have an xsi:type, and the item must be valid as appropriate.
Attributes
annotation of type XSAnnotation, readonly
An [ annotation] if it exists, otherwise null.
constraintType of type unsigned short, readonly
Namespace constraint: A constraint type: any, not, list.
nsConstraintList of type StringList, readonly
Namespace constraint: For constraintType NSCONSTRAINT_LIST, the list contains allowed namespaces. For constraintType NSCONSTRAINT_NOT, the list contains disallowed namespaces. For constraintType NSCONSTRAINT_ANY, the StringList is empty.
processContents of type unsigned short, readonly
[ process contents]: one of skip, lax or strict. Valid constants values are: PC_LAX, PC_SKIP and PC_STRICT.
Interface XSIDCDefinition

This interface represents the Identity-constraint Definition schema component.


IDL Definition
interface XSIDCDefinition : XSObject {

  // Identity Constraints
  const unsigned short      IC_KEY                         = 1;
  const unsigned short      IC_KEYREF                      = 2;
  const unsigned short      IC_UNIQUE                      = 3;

  readonly attribute unsigned short  category;
  readonly attribute GenericString   selectorStr;
  readonly attribute StringList      fieldStrs;
  readonly attribute XSIDCDefinition refKey;
  readonly attribute XSObjectList    annotations;
};

Definition group Identity Constraints

Identity-constraint category: one of key, keyref or unique.

Defined Constants
IC_KEY
See the definition of key in the identity-constraint category.
IC_KEYREF
See the definition of keyref in the identity-constraint category.
IC_UNIQUE
See the definition of unique in the identity-constraint category.
Attributes
annotations of type XSObjectList, readonly
A set of [ annotations] if it exists, otherwise an empty XSObjectList.
category of type unsigned short, readonly
[ identity-constraint category]: one of key, keyref or unique.
fieldStrs of type StringList, readonly
[ fields]: a non-empty list of restricted [XPath 1.0] expressions.
refKey of type XSIDCDefinition, readonly
[ referenced key]: required if [ identity-constraint category] is keyref, null otherwise. An identity-constraint definition with [ identity-constraint category] equal to key or unique.
selectorStr of type GenericString, readonly
[ selector]: a restricted [XPath 1.0] expression.
Interface XSNotationDeclaration

This interface represents the Notation Declaration schema component.


IDL Definition
interface XSNotationDeclaration : XSObject {
  readonly attribute GenericString   systemId;
  readonly attribute GenericString   publicId;
  readonly attribute XSAnnotation    annotation;
};

Attributes
annotation of type XSAnnotation, readonly
An [ annotation] if it exists, otherwise null.
publicId of type GenericString, readonly
The string representing the public identifier for this notation declaration, if present; null otherwise.
systemId of type GenericString, readonly
The URI reference representing the system identifier for the notation declaration, if present, null otherwise.
Interface XSAnnotation

This interface represents the Annotation schema component.


IDL Definition
interface XSAnnotation : XSObject {

  // TargetType
  const unsigned short      W3C_DOM_ELEMENT                = 1;
  const unsigned short      SAX_CONTENTHANDLER             = 2;
  const unsigned short      W3C_DOM_DOCUMENT               = 3;

  boolean            writeAnnotation(in GenericObject target, 
                                     in unsigned short targetType);
  readonly attribute GenericString   annotationString;
};

Definition group TargetType

An integer indicating the type of the target object.

Note: The codes between 1-10 are reserved by this specification. Other numeric codes could be added by implementations.

Defined Constants
SAX_CONTENTHANDLER
The object type is org.xml.sax.ContentHandler.
W3C_DOM_DOCUMENT
The object type is org.w3c.dom.Document.
W3C_DOM_ELEMENT
The object type is org.w3c.dom.Element.
Attributes
annotationString of type GenericString, readonly
A text representation of the annotation.
Methods
writeAnnotation
Write contents of the annotation to the specified object. If the specified target is a DOM object, in-scope namespace declarations for annotation element are added as attribute nodes of the serialized annotation, otherwise the corresponding events for all in-scope namespace declarations are sent via the specified document handler.
Parameters
target of type GenericObject
A target pointer to the annotation target object, i.e. org.w3c.dom.Document, org.w3c.dom.Element, org.xml.sax.ContentHandler.
targetType of type unsigned short
A target type.
Return Value

boolean

True if the target is a recognized type and supported by this implementation, otherwise false.

No Exceptions

1.3. Interfaces for accessing the Post Schema Validation Infoset (PSVI)

A proposed set of interfaces for accessing the PSVI components. The API does not define the following optional PSVI contributions:

1.3.1. PSVI information items

This section defines the post schema validation information items.

In an implementation that exposes element and attribute information items via some memory structures, objects that represent element information items should also implement ElementPSVI and objects that represent attribute information items should also implement AttributePSVI. For example, to expose the PSVI via the W3C [DOM], the objects that implement dom.Element should also implement ElementPSVI. The objects that implement dom.Attr should also implement AttributePSVI.

To request a DOM implementation that supports the PSVI, users should use org.w3c.dom DOMImplementationRegistry.getImplementation method with the value "psvi" for the features parameter and "1.0" for the version parameter. The DOMConfiguration should also recognize the "psvi" parameter (setting the value of this parameter to true will augment the DOM tree with the PSVI information). By default, the value of the "psvi" parameter is false.

Interface ItemPSVI

Represents an abstract PSVI item for an element or an attribute information item.


IDL Definition
interface ItemPSVI {
  const unsigned short      VALIDITY_NOTKNOWN              = 0;
  const unsigned short      VALIDITY_INVALID               = 1;
  const unsigned short      VALIDITY_VALID                 = 2;
  const unsigned short      VALIDATION_NONE                = 0;
  const unsigned short      VALIDATION_PARTIAL             = 1;
  const unsigned short      VALIDATION_FULL                = 2;
  readonly attribute GenericString   validationContext;
  readonly attribute unsigned short  validity;
  readonly attribute unsigned short  validationAttempted;
  readonly attribute StringList      errorCodes;
  readonly attribute GenericString   schemaNormalizedValue;
  readonly attribute GenericObject   actualNormalizedValue;
                                        // raises(XSException) on retrieval

  readonly attribute unsigned short  actualNormalizedValueType;
                                        // raises(XSException) on retrieval

  readonly attribute ShortList       itemValueTypes;
                                        // raises(XSException) on retrieval

  readonly attribute XSTypeDefinition typeDefinition;
  readonly attribute XSSimpleTypeDefinition memberTypeDefinition;
  readonly attribute GenericString   schemaDefault;
  readonly attribute boolean         isSchemaSpecified;
};

Constant VALIDITY_NOTKNOWN
Validity value indicating that validation has either not been performed or that a strict assessment of validity could not be performed.
Constant VALIDITY_INVALID
Validity value indicating that validation has been strictly assessed and the item in question is invalid according to the rules of schema validation.
Constant VALIDITY_VALID
Validation status indicating that schema validation has been performed and the item in question is valid according to the rules of schema validation.
Constant VALIDATION_NONE
Validation status indicating that schema validation has been performed and the item in question has specifically been skipped.
Constant VALIDATION_PARTIAL
Validation status indicating that schema validation has been performed on the item in question under the rules of lax validation.
Constant VALIDATION_FULL
Validation status indicating that full schema validation has been performed on the item.
Attributes
actualNormalizedValue of type GenericObject, readonly
[schema normalized value]: Binding specific actual value or null if the value is in error.
Exceptions on retrieval

XSException

NOT_SUPPORTED_ERR: Raised if the implementation does not support this method.

actualNormalizedValueType of type unsigned short, readonly
The actual value built-in datatype, e.g. STRING_DT, SHORT_DT. If the type definition of this value is a list type definition, this method returns LIST_DT. If the type definition of this value is a list type definition whose item type is a union type definition, this method returns LISTOFUNION_DT. To query the actual value of the list or list of union type definitions use itemValueTypes. If the actualNormalizedValue is null, this method returns UNAVAILABLE_DT.
Exceptions on retrieval

XSException

NOT_SUPPORTED_ERR: Raised if the implementation does not support this method.

errorCodes of type StringList, readonly
[schema error code]: a list of error codes generated from the validation attempt or an empty StringList if no errors occurred during the validation attempt.
itemValueTypes of type ShortList, readonly
In the case the actual value represents a list, i.e. the actualNormalizedValueType is LIST_DT, the returned array consists of one type kind which represents the itemType. For example:

<simpleType name="listtype">
 <list itemType="positiveInteger"/>
</simpleType>
<element name="list" type="listtype"/>
...

<list>1 2 3</list>
The schemaNormalizedValue value is "1 2 3", the actualNormalizedValueType value is LIST_DT, and the itemValueTypes is an array of size 1 with the value POSITIVEINTEGER_DT.
If the actual value represents a list type definition whose item type is a union type definition, i.e. LISTOFUNION_DT, for each actual value in the list the array contains the corresponding memberType kind. For example:

<simpleType name='union_type' memberTypes="integer string"/>

<simpleType name='listOfUnion'>
	<list itemType='union_type'/>
</simpleType>
<element name="list" type="listOfUnion"/>
...
<list>1 2 foo</list>
      
The schemaNormalizedValue value is "1 2 foo", the actualNormalizedValueType is LISTOFUNION_DT, and the itemValueTypes is an array of size 3 with the following values: INTEGER_DT, INTEGER_DT, STRING_DT.
Exceptions on retrieval

XSException

NOT_SUPPORTED_ERR: Raised if the implementation does not support this method.

memberTypeDefinition of type XSSimpleTypeDefinition, readonly
[member type definition]: if and only if that type definition is a simple type definition with {variety} union, or a complex type definition whose {content type} is a simple type definition with {variety} union, then an item isomorphic to that member of the union's {member type definitions} which actually validated the schema item's normalized value.
schemaDefault of type GenericString, readonly
[schema default]: the canonical lexical representation of the declaration's {value constraint} value. For more information refer to element schema default and attribute schema default.
schemaNormalizedValue of type GenericString, readonly
[schema normalized value]: the normalized value of this item after validation.
isSchemaSpecified of type boolean, readonly
[schema specified]: if true, the value was specified in the schema. If false, the value comes from the infoset. For more information refer to element specified and attribute specified.
typeDefinition of type XSTypeDefinition, readonly
[type definition]: an item isomorphic to the type definition used to validate the schema item.
validationAttempted of type unsigned short, readonly
[validation attempted]: determines the extent to which the schema item has been validated. The value will be one of the constants: VALIDATION_NONE, VALIDATION_PARTIAL or VALIDATION_FULL.
validationContext of type GenericString, readonly
The nearest ancestor element information item with a [schema information] property (or this element item itself if it has such a property). For more information refer to element validation context and attribute validation context .
validity of type unsigned short, readonly
[validity]: determines the validity of the schema item with respect to the validation being attempted. The value will be one of the constants: VALIDITY_NOTKNOWN, VALIDITY_INVALID or VALIDITY_VALID.
Interface ElementPSVI

Represents a PSVI item for one element information item.


IDL Definition
interface ElementPSVI : ItemPSVI {
  readonly attribute XSElementDeclaration elementDeclaration;
  readonly attribute XSNotationDeclaration notation;
  readonly attribute boolean         nil;
  readonly attribute XSModel         schemaInformation;
};

Attributes
elementDeclaration of type XSElementDeclaration, readonly
[ element declaration]: an item isomorphic to the element declaration used to validate this element.
nil of type boolean, readonly
[ nil]: true if clause 3.2 of Element Locally Valid (Element) (3.3.4) is satisfied, otherwise false.
notation of type XSNotationDeclaration, readonly
[ notation]: the notation declaration.
schemaInformation of type XSModel, readonly
schema information: the schema information property if it is the validation root, null otherwise.
Interface AttributePSVI

Represents a PSVI item for one attribute information item.


IDL Definition
interface AttributePSVI : ItemPSVI {
  readonly attribute XSAttributeDeclaration attributeDeclaration;
};

Attributes
attributeDeclaration of type XSAttributeDeclaration, readonly
[ attribute declaration]: An item isomorphic to the declaration component itself.

1.3.2. Post Schema Validation Infoset Provider (optional)

This section defines a PSVI provider for streaming models.

Interface PSVIProvider

This interface provides access to the post schema validation infoset for an API that provides a streaming document infoset, such as [SAX], XNI, and others.

For implementations that would like to provide access to the PSVI in a streaming model, a parser object should also implement the PSVIProvider interface. Within the scope of the methods handling the start and end of an element, applications may use the PSVIProvider to retrieve the PSVI related to the element and its attributes.


IDL Definition

Methods
getAttributePSVI
Provides AttributePSVI given the index of an attribute information item in the current element's attribute list. The method must be called by an application while in the scope of the methods which report the start and end of an element at a point where the attribute list is available. For example, for SAX the method must be called while in the scope of the document handler's startElement call. If the method is called outside of the specified scope, the return value is undefined.
Parameters
index of type unsigned long
The attribute index.
Return Value

AttributePSVI

The post schema validation properties of the attribute.

No Exceptions
getAttributePSVIByName
Provides AttributePSVI given the namespace name and the local name of an attribute information item in the current element's attribute list. The method must be called by an application while in the scope of the methods which report the start and end of an element at a point where the attribute list is available. For example, for SAX the method must be called while in the scope of the document handler's startElement call. If the method is called outside of the specified scope, the return value is undefined.
Parameters
uri of type GenericString
The namespace name of an attribute.
localname of type GenericString
The local name of an attribute.
Return Value

AttributePSVI

The post schema validation properties of the attribute.

No Exceptions
getElementPSVI
Provides the post schema validation item for the current element information item. The method must be called by an application while in the scope of the methods which report the start and end of an element. For example, for SAX the method must be called within the scope of the document handler's startElement or endElement call. If the method is called outside of the specified scope, the return value is undefined.
Return Value

ElementPSVI

The post schema validation infoset for the current element.
If an element information item is valid, then in the post-schema-validation infoset the following properties must be available for the element information item:

  • The following properties are available in the scope of the method that reports the start of an element: {element declaration}, {validation context}, {notation}. The {schema information} property is available for the validation root. The {error codes} property is available if any errors occurred during validation.
  • The following properties are available in the scope of the method that reports the end of an element: {nil}, {schema specified}, {normalized value},{ member type definition}, {validity}, {validation attempted}. If the declaration has a value constraint, the property {schema default} is available. The {error codes} property is available if any errors occurred during validation. Note: some processors may choose to provide all the PSVI properties in the scope of the method that reports the end of an element.
No Parameters
No Exceptions

1.4. Loading XML Schema documents (optional)

This section defines a set of optional interfaces to allow users to load XML Schema documents.

1.4.1. Bootstrapping

This section defines the XSImplementation interface that provides a method to create an XSLoader using the DOM Level 3 Bootstrapping mechanism. An application can find implementations of the XSLoader using getDOMImplementation method on the DOMImplementationRegistry object with the feature string "XS-Loader" and version "1.0".

Interface XSImplementation

This interface allows one to retrieve an instance of XSLoader. This interface should be implemented on the same object that implements DOMImplementation.


IDL Definition
interface XSImplementation {
  readonly attribute StringList      recognizedVersions;
  XSLoader           createXSLoader(in StringList versions)
                                        raises(XSException);
};

Attributes
recognizedVersions of type StringList
A list containing the versions of XML Schema documents recognized by this XSImplementation.
Methods
createXSLoader
Creates a new XSLoader. The newly constructed loader may then be configured and used to load XML Schemas.
Parameters
versions of type StringList
A list containing the versions of XML Schema documents which can be loaded by the XSLoader or null to permit XML Schema documents of any recognized version to be loaded by the XSLoader.
Return Value

XSLoader

An XML Schema loader.

Exceptions

XSException

NOT_SUPPORTED_ERR: Raised if the implementation does not support one of the specified versions.

1.4.2. XML Schema Loader

This section defines the XSLoader interface that defines methods to load XML Schema documents.

Interface XSLoader

An interface that provides a method to load XML Schema documents. This interface uses the DOM Level 3 Core and Load and Save interfaces.


IDL Definition
interface XSLoader {
  readonly attribute DOMConfiguration config;
  XSModel            loadURIList(in StringList uriList);
  XSModel            loadInputList(in LSInputList is);
  XSModel            loadURI(in GenericString uri);
  XSModel            load(in LSInput is);
};

Attributes
config of type DOMConfiguration, readonly
The configuration of a document. It maintains a table of recognized parameters. Using the configuration, it is possible to change the behavior of the load methods. The configuration may support the setting of and the retrieval of the following non-boolean parameters defined on the DOMConfiguration interface: error-handler (DOMErrorHandler) and resource-resolver (LSResourceResolver).
The following list of boolean parameters is defined:
"validate"
true
[required] (default)
Validate an XML Schema during loading. If validation errors are found, the error handler is notified.
false
[optional]
Do not report errors during the loading of an XML Schema document.
Methods
load
Parse an XML Schema document from a resource identified by a LSInput .
Parameters
is of type LSInput
The LSInputSource from which the source document is to be read.
Return Value

XSModel

An XSModel representing this schema.

No Exceptions
loadInputList
Parses the content of XML Schema documents specified as a list of LSInputs.
Parameters
is of type LSInputList
The list of LSInputs from which the XML Schema documents are to be read.
Return Value

XSModel

An XSModel representing the schema documents.

No Exceptions
loadURI
Parse an XML Schema document from a location identified by a URI reference. If the URI contains a fragment identifier, the behavior is not defined by this specification.
Parameters
uri of type GenericString
The location of the XML Schema document to be read.
Return Value

XSModel

An XSModel representing this schema.

No Exceptions
loadURIList
Parses the content of XML Schema documents specified as the list of URI references. If the URI contains a fragment identifier, the behavior is not defined by this specification.
Parameters
uriList of type StringList
The list of URI locations.
Return Value

XSModel

An XSModel representing the schema documents.

No Exceptions