W3C

XML Schema: Component Designators

W3C Working Draft 29 March 2005

This version:
http://www.w3.org/TR/2005/WD-xmlschema-ref-20050329/
Latest version:
http://www.w3.org/TR/xmlschema-ref/
Previous versions:
http://www.w3.org/TR/2004/WD-xmlschema-ref-20040716/
http://www.w3.org/TR/2004/WD-xmlschema-ref-20040309/
http://www.w3.org/TR/2003/WD-xmlschema-ref-20030109/
Editors:
Mary Holstege, Mark Logic Corporation
Asir S. Vedamuthu, webMethods

This document is also available in these non-normative formats: XML.


Abstract

XML Schema: Component Designators defines a scheme for identifying XML Schema components as specified by XML Schema Part 1: Structures and XML Schema Part 2: Datatypes.

Status of this Document

This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at http://www.w3.org/TR/.

This is a W3C Last Call Working Draft of the XML Schema: Component Designators document for review by members of the public and by members and other Working Groups of the World Wide Web Consortium. It has been produced by the W3C XML Schema Working Group (WG) as part of the XML Activity. It incorporates all Working Group decisions through 2005-03-04. It has been reviewed by the working group and the working group has agreed to publication as a Last Call draft. The Last Call comment period is expected to end 26 April 2005. Following this Last Call for review the Working Group intends to submit this specification as a publication for Candidate Recommendation.

This schedule may vary, depending on the comments of the public and of other W3C working groups on this draft. Such comments are instrumental in the WG's deliberations, and we encourage readers to review the draft and to send comments to www-xml-schema-comments@w3.org mailing list (archived at http://lists.w3.org/Archives/Public/www-xml-schema-comments/). Commenters are requested to put the string "[XSCD]" at the beginning of the subject field of email messages. Note that all outstanding issues against this document are documented in the Working Group's running issues list.

Although the Working Group does not anticipate further changes to the functionality described here, this is still a working draft, subject to change. The present version should be implemented only by those interested in providing a check on its design or by those preparing for an implementation of the Candidate Recommendation. The Schema WG will not allow early implementation to constrain its ability to make changes to this specification prior to final release.

Publication as a Working Draft does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.

A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at http://www.w3.org/TR/. They may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to use W3C Working Drafts as reference material or to cite them as other than "work in progress".

The following changes were made since the last working draft:

This document was produced under the 5 February 2004 W3C Patent Policy. The Working Group maintains a public list of patent disclosures relevant to this document; that page also includes instructions for disclosing [and excluding] a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) with respect to this specification should disclose the information in accordance with section 6 of the W3C Patent Policy.

Table of Contents

1 Introduction (Non-Normative)
2 Goals and Use Cases (Non-Normative)
    2.1 Requirements
    2.2 Use Cases
3 Schema Component Designators
    3.1 Schema Component Designator Syntax
    3.2 Canonical Schema Component Designators
    3.3 Equality of Schema Component Designators
4 Schema Component Paths
    4.1 Schema Component Graph Traversal
    4.2 Schema Component Path Syntax
    4.3 Canonical Schema Component Paths
    4.4 Equality of Schema Component Paths
5 Conformance
    5.1 Schema Component Path Conformance
    5.2 Schema Component Designator Conformance
6 Example (Non-Normative)

Appendices

A Schema Component Properties (Non-Normative)
B Glossary (Non-Normative)
C References
    C.1 Normative References
    C.2 Non-normative Informational References


1 Introduction (Non-Normative)

This document defines a system for designating XML Schema components. Part 1 of the W3C XML Schema recommendation [XSD1] defines these schema components. Section 2.2 lays out the inventory of schema components into three classes:

In addition there is a master schema component, the schema component representing the schema as a whole.

Finally, there are schema components for the facets defined in Part 2 of the W3C XML Schema recommendation [XSD2]:

At first blush, a QName (prefix:localname) may seem sufficient to the task of designating any schema component. This is incorrect for various reasons:

  1. A QName is only meaningful in the context of particular namespace bindings so that the QName can be resolved to a particular extended name, or {namespace name, local name} pair.

  2. The same extended name can be used in a particular schema to refer to an element declaration, an attribute declaration, a complex type or simple type definition, a model group definition, an attribute group definition, an identity constraint definition, and a notation declaration.

  3. Locally scoped element and attribute declarations cannot be uniquely named by an extended name.

  4. Anonymous type definitions have no extended name, or they have an extended name that is dependent upon the particular schema processor interpreting the schema.

  5. Certain schema components (annotation, particle, wildcard) are purely subordinate to some other schema component, and have no name of their own.

  6. Certain schema components (attribute use and model group) are subordinate to some other schema component, and any name they might be construed to have is a reference to some other schema component (attribute declaration and model group definition, respectively).

  7. The schema-as-a-whole schema component has no name at all.

  8. The redefinition schema composition feature creates the situation where there are two variants of the 'same' schema component, both with the same name, one of which is derived from the other. If it is necessary to be able to name the base component, the same name cannot be used for both.

A key technical challenge to obtaining a useful system of naming XML Schema components is to address these issues or decide that certain cases need not be addressed. In particular:

  1. Designators must either include full extended names, or define namespace bindings.

  2. Designators must distinguish named components in different symbol spaces from one another.

  3. Designators must provide a means of distinguishing locally scoped element and attribute declarations with the same name.

  4. Designators must provide for any designatable unnamed components, such as anonymous type definitions, wildcards, and the schema-as-a-whole component.

  5. Designators must function in the face of redefinitions.

The schema-as-a-whole schema component may represent the amalgamation of several distinct schema documents, or none at all. It may be associated with any number of target namespaces, including none at all. It may have been obtained for a particular schema assessment episode by de-referencing URIs given in schemaLocation attributes, or by an association with the target namespace or by some other application-specific means. In short, there are substantial technical challenges to defining a reliable designator for the schema-as-a-whole, particularly if that designator is expected to serve as a starting point for the other components encompassed by that schema.

This specification divides the problem of constructing schema component designators into two parts: defining a designator for an assembled schema, and defining a designator for a particular schema component or schema components, understood relative to a designated schema.

2 Goals and Use Cases (Non-Normative)

2.1 Requirements

Basic Functionality
  1. Designators should be unambiguous, designating exactly one component within a schema. However, certain abbreviation and wildcarding constructs may designate collections of components. In any case, each component should have at least one unambiguous designator that designates that component and no other.

  2. It should be possible to designate any schema component within a schema. However, some exceptions will be made for certain of the helper components.

  3. Designators should provide (or assure) a URI for the unique identification of a schema.

  4. If there is more than one designator for a construct, there should be exactly one canonical form of the designator.

Properties of the Designator
  1. Designators should be human-readable.

  2. Given a designator, it should be possible to get the extended name for the designated component, if one exists for that component.

  3. It should be possible to algorithmically and consistently generate the canonical designator for each component, either against an assembled schema or as the schema is assembled.

  4. Designators should be parsable with compositional semantics (or, in other words, they should have expressive notation).

  5. There should be a formal specification of what constitutes a legal designator.

Compatibility
  1. Designators should be URI references.

  2. Designators should work well in a RDDL environment.

Non-goals
  1. It is not a requirement to designate particle components as distinct from terms.

  2. It is not a requirement to tie schema component validity to namespace validity.

  3. It is not a requirement that it be possible to construct designators to refer to arbitrary schema components without any knowledge of schema internals.

  4. It is not a requirement to be able to tell, from a schema component designator for an element declaration, whether instances of that element declaration must appear in document instances with qualified or unqualified names.

  5. It is not a requirement to uniquely assign schema component designators (element, attribute, and type designators) to information items in a document instance given only a set of schema component designators.

2.2 Use Cases

Type references

In general Schema Component Designators can be used to provide references to arbitrary types, whether they are named global types or local or anonymous types. These use cases all benefit from being able to refer to any type declaration.

Element declaration references

These use cases benefit from being able to refer to any element declaration.

Stand-off Schema Annotation

Schema component designators can be used to refer to specific parts of a schema to provide an out-of-band annotation capability, for commentary, error reporting, or the association of layered semantics with schema components.

Miscellaneous text-based uses within schema-based tools

Having a simple textual way to refer to the abstract components of a schema enables certain kinds of text-based schema-related processing.

Other

3 Schema Component Designators

Schema component designators rely on a layered model of schema component reference. Schema component paths designate components in the context of a particular schema assembly. Full blown schema designators build on this by applying the schema component paths in the context of a URI reference, where the URI identifies the schema, and the fragment part encapsulates a schema component path to designate components in the context of that schema.

This section describes schema component designators as a whole. The details of schema component paths are described in 4 Schema Component Paths.

[Definition: A schema designator is a single URI for a resource representing an assembled schema.]

Many possible conventions for obtaining a single URI to refer to a schema are possible. In the simplest case, where there is one root schema document, the URI of that document suffices. In other cases a schema may have been assembled from multiple schema documents, or from components obtained via other representations, and some representation of that collection or of the assembled results will be required.

We expect that it will be highly desirable for the community to evolve one convention for referring to an assembled schema to ensure consistency of global schema component designators. This specification declines to specify what that one way should be.

Note:

The representation of a resource obtained by dereferencing a schema URI must allow for the fragment identifier syntax defined here. The representation of the resource either needs to be an XML encoding to fit with the XPointer framework, or its definition needs to explicitly entail a compatible fragment identifier syntax.

The schema component reference core defines reference to a schema component in the context of an assembled XML Schema. 4 Schema Component Paths defines this relationship between an assemblage of schema components and component paths. Schema assembly is described in Section 4 of XML Schema Part 1: Structures.

For the purposes of component paths, a missing component cannot be used to construct a valid path; nor can a schema component be successfully referenced through a path that references a missing component.

[Definition: An absolute schema component designator consists of two parts: a designator for the assembled schema (a schema designator), and a designator for a particular schema component or schema components relative (a relative schema component designator) to that assembled schema.]

Syntactically, the first part is a URI, and the second part is an XPointer fragment identifier. An absolute schema component designator therefore is a URI reference.

[Definition: The relative schema component designator is an XPointer scheme xscd() that uses a schema component path as the scheme data.] This XPointer scheme may be used in combination with the XPointer xmlns() scheme. It must not be used in combination with other XPointer schemes. The construction and syntax of schema component paths are described in 4 Schema Component Paths.

3.1 Schema Component Designator Syntax

EBNF
[1]   SchemaComponentDesignator   ::=   AbsoluteSchemaComponentDesignator | RelativeSchemaComponentDesignator
[2]   AbsoluteSchemaComponentDesignator   ::=   SchemaDesignator '#' RelativeSchemaComponentDesignator
[3]   SchemaDesignator   ::=   URI
[4]   RelativeSchemaComponentDesignator   ::=   XmlnsPointerPart* XscdPointerPart
[5]   XmlnsPointerPart   ::=    'xmlns' '(' XmlnsSchemeData ')'
[6]   XscdPointerPart   ::=   'xscd' '(' SchemaComponentPath ')'

3.2 Canonical Schema Component Designators

[Definition: A canonical schema component designator is an absolute schema component designator that is a URI that has been normalized according to the rules given in the update to RFC2396 and where the relative schema component designator consists of an xmlns XPointer pointer part (if required) followed by a canonicalized xscd XPointer pointer part. ]

[Definition: A canonicalized xscd XPointer pointer part is an xscd XPointer pointer part where the pointer data is a canonical schema component path. ]

4 Schema Component Paths

An assembled schema forms a graph of schema components, where certain schema component properties contain other schema components as their values (or part of their values). Schema component paths can be regarded as being constructed step-by-step by traversing the schema component properties, starting at the schema-as-a-whole schema component. Within this graph there may be more than one path to a particular schema component. This section describes the general procedure for traversing the graph and constructing paths, and then defines which path is the canonical one.

For the purposes of schema component paths, presume the existence of an {identity constraint definitions} property of the schema-as-a-whole component whose value is the union of all identity constraint components in the assembled schema. Future revisions of the XML Schema specification may define this property.

[Definition: A schema component path is a series of [step] pieces, each of which corresponds to a particular schema component along the path from the schema-as-a-whole schema component.] Each step has a concrete syntactic representation, which is described in 4.2 Schema Component Path Syntax.

[Definition: A [step] represents a schema component along the path from the schema-as-a-whole schema component. Each [step] has a possibly empty [target namespace], a possibly empty [name], and possible empty [predicate], a [schema component kind], and an [axis].] The values for these properties are defined for specific schema components, below, but in general the [target namespace] will have the same value as the {target namespace} property of the schema component and the [name] will have the value as the {name} property of the schema component. The value of [schema component kind] is a label for the kind of schema component involved and the value of [axis] is a label for the component property leading to the component. The [predicate] is used to select schema components that have no name to distinguish them or where the name does not suffice to distinguish them, such as instances of element declarations within a term.

4.1 Schema Component Graph Traversal

An assembled schema consists of a graph of schema components. The following schema component properties have as their values (or a part of their values) other schema components, thus creating the links in the graph which may be traversed to construct a schema component path.

Traversal through the schema component graph occurs through any of the properties by taking a member of one of these lists as the basis for the next [step]:

{type definitions}
{attribute declarations}
{element declarations}
{attribute group definitions}
{model group definitions}
{notation declarations}
{identity constraint definitions}
{facets}
{fundamental facets}
{member type definitions}
{attribute uses}
{particles}

Traversal through the schema component graph occurs through any of the following properties by taking that schema component as the basis for the next [step].

{type definition}
{item type definition}
{attribute wildcard}
{model group}
{attribute declaration}
{term}
{base type definition}
{primitive type definition}
{substitution group affiliation}
{referenced key}

Traversal through the schema component graph occurs to the following properties, but in a somewhat special way, as referring to a collection of annotations as a group, rather than to an individual annotation component. This is because we cannot distinguish between individual annotations.

{annotations}
{annotation}

Traversal through the schema component graph occurs through the following properties, but in different ways depending on what kind of value it has:

{content type}
{scope}

Traversal will proceed through the particle of the {content type} property if a content model is present, or through the {content type} property directly if it is a simple type definition. Traversal will proceed through the {scope} property unless it has the value "global".

[Definition: A traversal from one component to another takes place across some particular component property. This property is the axis of traversal. ]

[Definition: A default axis is a privileged axis of traversal. ] The default axes are:

{type definition}
{content type}
{attribute declaration}
{attribute uses}
{model group}
{particles}
{term}
{element declarations}
{facets}

4.2 Schema Component Path Syntax

In general the syntax of a step of the schema component path has the following form:

where ns-prefix is bound to the [target namespace] of the component. In the context of schema component designators the namespace prefixes will be bound via the xmlns XPointer scheme; in the context of an XML document the namespace prefixes will be bound in the conventional way (using the [in-scope namespaces] property of the element information item); other host languages will define their own namespace binding rules.

Non-default axes may use the axis name instead of the schema component kind, in order to disambiguate the traversal.

The syntax provides various abbreviations as defined below.

Each kind of step accepts a wildcarding construct, which uses the special literal * instead of the name and has the form:

A wildcarded step has the properties:

[target namespace]
[name]*
[schema component kind]See various component steps
[axis]See various component steps
[predicate]

Such a step refers to the set of all successor components of the given kind. Implementations will have to exercise care to properly handle circularities in the component graph in determining the set of components matched by a path.

A step involving an anonymous component uses the name 0:

This name cannot have any conflict with any possible named component, as 0 is not a valid name start character.

Steps in the path are separated by a slash:

except in the case of the schema-as-a-whole component, which is represented by a bare slash already, so no additional separator is necessary.

4.2.2 Attribute Declaration

The [step] for an attribute declaration schema component has the properties:

[target namespace]Value of {target namespace}
[name]Value of {name}
[schema component kind]attribute
[axis]attribute declaration
[predicate]

4.2.3 Element Declaration

The [step] for an element declaration schema component has the properties:

[target namespace]Value of {target namespace}
[name]Value of {name}
[schema component kind]element
[axis]element declaration, term, or substitution group affiliation
[predicate]None if the [axis] is substitution group affiliation or if the {scope} is global. Otherwise, the pair {position, n} where n is the position of the element declaration among other element declarations with the same {target namespace} and {name} property values among the {particles} in the superordinate model group.

4.2.4 Simple Type Definition

The [step] for a simple type definition schema component has the properties:

[target namespace]Value of {target namespace}
[name]Value of {name}
[schema component kind]simpleType
[axis]type definition, base type definition, member type definition, item type definition, or primitive type definition
[predicate] If the [axis] is member type definition, the pair {position, n} where n is the position of this simple type definition among S's {member type definitions}. Otherwise, none.

4.2.6 Attribute Group Definition

The [step] for an attribute group definition schema component has the properties:

[target namespace]Value of {target namespace}
[name]Value of {name}
[schema component kind]attributeGroup
[axis]attribute group definition
[predicate]

4.2.7 Model Group Definition

The [step] for a model group definition schema component has the properties:

[target namespace]Value of {target namespace}
[name]Value of {name}
[schema component kind]group
[axis]model group definition
[predicate]

4.2.8 Identity-constraint definition

The [step] for an identity-constraint definition schema component has the properties:

[target namespace]Value of {target namespace}
[name]Value of {name}
[schema component kind]identityConstraint
[axis]identity constraint definition or referenced key
[predicate]

4.2.9 Notation declaration

The [step] for a notation declaration schema component has the properties:

[target namespace]Value of {target namespace}
[name]Value of {name}
[schema component kind]notation
[axis]notation declaration
[predicate]

4.2.11 Model Group

The [step] for a model group schema component has the properties:

[target namespace]
[name]
[schema component kind]The value of the {compositor} property, one of sequence, choice, or all
[axis]model group or term
[predicate]The pair {position, n} where n is the position of the model group with respect to other model groups among {particles} with the same {compositor} property value if this model group is one particle of a superordinate model group.

4.2.13 Wildcard

The [step] for a wildcard schema component has the properties:

[target namespace]
[name]
[schema component kind]If the wildcard is the {term} of some particle, then any, otherwise anyAttribute
[axis]term
[predicate]If the [schema component kind] is any, the pair {position, n} where n is the position of the wildcard with respect to other wildcards among {particles} of the superordinate model group.

4.2.15 Facets

The [step] for a facet schema component has the properties:

[target namespace]
[name]The facet name, one of whiteSpace, minInclusive, maxInclusive, minExclusive, maxExclusive, totalDigits, fractionDigits, length, minLength, maxLength, pattern, enumeration, ordered, bounded, cardinality, or numeric
[schema component kind]facet
[axis]facet or fundamental facet
[predicate]

4.2.16 Examples of Schema Component Paths (Non-Normative)

The following examples assume the namespace prefixes have been properly bound.

A schema component path referring to the type (either simple or complex) whose local name is title and which is in the namespace denoted by the prefix my:

A schema component path referring to the globally declared element whose local name is title and which is in the namespace denoted by the prefix my:

A schema component path referring to the globally declared attribute whose local name is title and which is in the namespace denoted by the prefix my:

A schema component path referring to the globally declared attribute group whose local name is title and which is in the namespace denoted by the prefix my:

A schema component path referring to the pattern facet of the globally declared simple type whose local name is title which is in the namespace denoted by my:

Given this schema fragment for a schema whose target namespace is denoted by the prefix my:

The following schema component path refers to the first element of the named complex type:

And the following schema component path refers to the second:

A schema component path referring to the (anonymous) complex type of the globally defined element:

A schema component path that refers to the wildcard in the globally defined element:

A schema component path that refers to the attribute of the globally defined element:

4.2.17 Path Abbreviations

[Definition: An intermediate step is a [step] piece that is neither the first step nor the last step in a schema component path.] [Definition: Head steps are a series of steps in a schema component path, begin with the first step and end with any step that is not the last step in a schema component path.]

The following three types of intermediate step sequences are optional in the schema component path syntax:

  1. An intermediate step that corresponds to a complex type component that was reached via a default axis.
  2. A series of intermediate steps corresponding to model group components. This series begins and ends with a model group step and contains all the consecutive model group steps to the end of the series.
  3. A combination of the above two intermediate step sequences in that order.

The syntax // or component::* can be used to abbreviate head steps or a sequence of intermediate steps in a schema component path, provided that all those steps corrrespond to default axes.

Paths with elided steps or // separators will designate sets of components: the set of all components that can be reached by such a path. Implementations constructing such sets will need to take care to correctly handle circularity in the component graph.

4.2.18 EBNF for Schema Component Path Syntax

Path EBNF
[7]   SchemaComponentPath   ::=   SchemaStep | StepSepator RelativeSchemaComponentPath
[8]   SchemaStep   ::=   '/'
[9]   RelativeSchemaComponentPath   ::=   Step | Step StepSeparator RelativeSchemaComponentPath
[10]   StepSeparator   ::=   '/' | '//'
[11]   Step   ::=   AttributeStep | ElementStep | SimpleTypeStep | ComplexTypeStep | AttributeGroupStep | GroupStep | IdentityConstraintStep | NotationStep | AnnotationsStep | ModelGroupStep | WildcardStep | FacetStep
[12]   NameOrWildcard   ::=   QName | '*'
[13]   NameWildcardOrAnonymous   ::=   QName | '*' | '0'
[14]   AttributeStep   ::=   AttributeFullform | AttributeShortform
[15]   AttributeFullform   ::=   'attribute' '::' NameOrWildcard
[16]   AttributeShortform   ::=   '@' NameOrWildcard
[17]   ElementStep   ::=    ( ( ElementFullform | ElementShortform ) Predicate? ) | SubstitutionGroupAxis
[18]   ElementFullform   ::=   'element' '::' NameOrWildcard
[19]   ElementShortform   ::=   NameOrWildcard
[20]   SubstitutionGroupAxis   ::=   'substitutionGroup' '::' NameOrWildcard
[21]   SimpleTypeStep   ::=   TypeDefinitionAxis | BaseTypeAxis | PrimitiveTypeAxis | ItemTypeAxis | MemberTypeAxis
[22]   TypeDefinitionAxis   ::=   TypeDefinitionAxisFullform | TypeDefinitionAxisShortform
[23]   TypeDefinitionAxisFullform   ::=   'type' '::' NameWildcardOrAnonymous
[24]   TypeDefinitionAxisShortform   ::=   '~' NameWildcardOrAnonymous
[25]   BaseTypeAxis   ::=   'baseType' '::' NameOrWildcard
[26]   PrimitiveTypeAxis   ::=   'primitiveType' '::' NameOrWildcard
[27]   ItemTypeAxis   ::=   'itemType' '::' NameWildcardOrAnonymous
[28]   MemberTypeAxis   ::=   'memberType' '::' NameWildcardOrAnonymous Predicate?
[29]   ComplexTypeStep   ::=   TypeDefinitionAxis | BaseTypeAxis | ScopeAxis
[30]   ScopeAxis   ::=   'scope' '::' NameWildcardOrAnonymous
[31]   AttributeGroupStep   ::=   'attributeGroup' '::' NameOrWildcard
[32]   GroupStep   ::=   'group' '::' NameOrWildcard
[33]   IdentityConstraintStep   ::=   IdentityConstraintAxis | ReferencedKeyAxis
[34]   IdentityConstraintAxis   ::=   'identityContraint' '::' NameOrWildcard
[35]   ReferencedKeyAxis   ::=   'key' '::' NameOrWildcard
[36]   NotationStep   ::=   'notation' '::' NameOrWildcard
[37]   AnnotationsStep   ::=   'annotation' '::' '*'
[38]   ModelGroupStep   ::=   'model' '::' ('sequence' | 'choice' | 'all' | '*') ')' Predicate?
[39]   WildcardStep   ::=    ( 'any' '::' '*' Predicate? ) | ('anyAttribute' '::' '*')
[40]   FacetStep   ::=   'facet' '::' ( FacetName | '*' )
[41]   FacetName   ::=   'ordered' | 'bounded' | 'numeric' | 'cardinality' | 'whiteSpace' | 'minInclusive' | 'maxInclusive' | 'minExclusive' | 'maxExclusive' | 'totalDigits' | 'fractionDigits' | 'length' | 'minLength' | 'maxLength' | 'pattern' | 'enumeration'
[42]   Predicate   ::=   '[' [0-9]+ ']'

4.3 Canonical Schema Component Paths

[Definition: The canonical schema component path of a component is a distinguished valid component path that uniquely identifies that particular component, that has as few steps as possible, and that can be deterministically constructed. ]

The remainder of this section consists of a constructive definition of canonical schema component paths: a path produced by this construction will be the canonical one.

[Definition: The current schema component is a schema component for which there is a valid canonical path through the schema component graph.]

[Definition: The target schema component is a schema component linked to the current schema component via one of the schema component properties defined previously.]

[Definition: The component relationship is the name of the schema component property on the current schema component which references the target schema component. ]

[Definition: The ancestor set of the target schema component is the set of schema components on the valid canonical path to the current schema component together with the current schema component.]

[Definition: The base type set of a schema component is the set consisting of the {base type definition} of that schema component and the {base type definition} of every member of the set. ]

Constructively, this set can be computed by adding the {base type definition} to the set, and iterating on that type component, until you see a component whose {target namespace} property is "http://www.w3.org/2001/XMLSchema" and whose {name} property is "anyType".

[Definition: The extended base type set of a schema component is the set consisting of the {base type definition} of that schema component if its {derivation} method is "extension" and the {base type definition} of every member of the set whose {derivation} method is "extension". ]

[Definition: The base facet set of a schema component is the set consisting of all members of the {facets} property of members of the base type set of that schema component.]

[Definition: Two facets are the same if they are the same kind of component (e.g. both are length facets) and their {value} properties have identical values.]

[Definition: The base attribute use set of a schema component is the set consisting of all members of the {attribute uses} property of members of the base type set of that schema component.]

[Definition: Two attribute uses are the same if the {name} and {target namespace} of their {attribute declaration} properties are equal. ]

(Note that this is not equality which requires checking the {type definition} as well. However, the rules for component consistency will ensure that checking the {name} and {target namespace} suffices for our purposes here.)

[Definition: The particle set of a schema component is the set consisting of the {content type} of that schema component with the members of the {particles} property of the {term} of any member of the set.]

[Definition: The base particle set of a schema component is the union of all particle sets of all the members of the extended base type set of that schema component.]

[Definition: Two particles are the same if the implementation reports them as the same.] Informally, implementations will report particles that are "inherited" from base types as "the same" as the corresponding particle in the base type. Future revisions of the XML Schema recommendation will specify more precisely the conditions under which particles should be regarded as "the same".

Traversal where the current schema component is the schema-as-a-whole component to any target schema component is always permitted in the construction of a canonical path. If the current schema component is not the schema-as-a-whole schema component, then traversal from the current schema component to the target schema component is forbidden in the construction of a canonical path if any of the following conditions is met:

  1. the target schema component is an identity constraint definition

  2. the target schema component is a simple or complex type definition whose {name} property is not absent

  3. the target schema component is an element or attribute declaration whose {scope} property is global

  4. the target schema component has a {scope} property whose value is a schema component and that schema component is not a member of the ancestor set of the target schema component

  5. the component relationship is {scope}, {substitution group affiliation}, {primitive type definition}, or {referenced key}

  6. the component relationship is {base type definition} and target schema component's {name} property is not absent

  7. the target schema component is a facet and there exists some facet in its base facet set of the target schema component that is the same as the facet

  8. the current schema component is a complex type, the target schema component is the {attribute declaration} of an attribute use component and there exists some attribute use in the base attribute use set of the current schema component that is the same as the attribute use whose {attribute declaration} is the target schema component

  9. the target schema component is the {term} of a particle and there exists some particle in the base particle set of the current schema component that is the same as the target schema component

Informally, the first two conditions ensure that the canonical path to an identity constraint or a named type is the one that flows directly from the schema-as-a-whole component, the third condition ensures that the canonical path to element and attribute declarations is likewise the global one (if there is one), the fourth condition accounts for element and attribute declarations stemming from named model groups and attribute groups, the fifth and sixth ensure that the canonical path doesn't follow "backwards" paths (while accounting for redefined types), and the final three conditions ensure the canonical path to "inherited" components goes through their component of origin.

In general, it is not possible to obtain the canonical path for a schema component without access to the schema component graph. In particular, canonicalizing some non-canonical path, or determining whether a schema component path is canonical cannot be performed without such access.

For example, consider the path /type::x:foo/element::x:bar.

For this schema fragment, this represents a canonical path to the local element bar:

<complexType name="foo">
  <sequence>
     <element name="bar" type="x:barType"/>
  </sequence>
</complexType>

But for this schema fragment, it represents a non-canonical path. The canonical path would be /group::x:barGroup/element::x:bar.

<group name="barGroup">
  <sequence>
     <element name="bar" type="x:barType"/>
  </sequence>
</group>
<complexType name="foo">
  <sequence>
    <group ref="x:barGroup"/>
  </sequence>
</complexType>

4.4 Equality of Schema Component Paths

[Definition: Two schema component paths are equal if they have the same number of steps, and each step in one path is equal to the corresponding step in the other. Steps are equal if all of their properties have the same value.]

Note: This definition of equality neither relies on the notion of 'the same component' nor defines component equivalence. A schema component may have multiple schema component paths. Although these schema component paths address 'the same component', they are not equal. It is true, however, that two canonical paths to the same component will be equal.

5 Conformance

6 Example (Non-Normative)

This section walks through an example XML Schema Document from the XML Schema Part 0: Primer and enumerates the abbreviated and canonical schema component designators for schema components.

All schema constructs in this section are considered to be in the following schema document and its URI is schema-URI,

The canonical schema component designator for this schema-as-a-whole component is schema-URI#xscd(/).

The canonical schema component designator for this annotation schema component is schema-URI#xscd(/annotation::*).

The following is a global element declaration,

The abbreviated schema component designator for this element declaration component is schema-URI#xscd(/purchaseOrder) and the canonical is schema-URI#xscd(/element::purchaseOrder).

The following is another global element declaration,

The abbreviated schema component designator for this element declaration component is schema-URI#xscd(/comment) and the canonical is schema-URI#xscd(/element::comment).

This following is a global complex type definition component,

The abbreviated schema component designator for this complex type definition and its element and attribute declaration components are,

The canonical schema component designator for this complex type definition and its element and attribute declaration components are,

The following is another global complex type definition component,

The abbreviated schema component designator for this complex type definition and its element and attribute declaration components are,

The canonical schema component designator for this complex type definition and its element and attribute declaration components are,

The following is a global complex type definition with anonymous complex type and simple type definition components,

The abbreviated schema component designator for this complex type definition and its element and attribute declaration, simple type definition, and facet components are,

The canonical schema component designator for this complex type definition and its element and attribute declaration, simple type definition, and facet components are,

The following is a global simple type definition component,

The canonical schema component designator for this simple type definition and its facet component are,

A Schema Component Properties (Non-Normative)

Schema component paths rely on the schema component graph implicit in the assembled collection of schema components and their properties. The following table details which properties are used for defining schema component paths, and whether they are used to define links in the graph (traversed) or just referenced for some other purpose. Traversals marked with a star (*) are the default axis of traversal.

ComponentPropertyUse
Attribute Declaration
{type definition}traversed *
{annotation}traversed (special)
{name}referenced
{target namespace}referenced
{scope}traversed
{value constraint}none
Element Declaration
{type definition}traversed *
{identity-constraint definitions}traversed
{annotation}traversed (special)
{name}referenced
{target namespace}referenced
{scope}traversed
{value constraint}none
{nillable}none
{substitution group affiliation}traversed
{substitution group exclusions}none
{disallowed substitutions}none
{abstract}none
Complex Type Definition
{base type definition}traversed
{attribute uses}traversed
{attribute wildcard}traversed
{content type}traversed *
{annotations}traversed (special)
{name}referenced
{target namespace}referenced
{derivation method}none
{final}none
{abstract}none
{prohibited substitutions}none
Attribute Use
{attribute declaration}traversed *
{value constraint}none
{required}none
Attribute Group Definition
{attribute uses}traversed *
{attribute wildcard}traversed
{annotation}traversed (special)
{name}referenced
{target namespace}referenced
Model Group Definition
{model group}traversed *
{annotation}traversed (special)
{name}referenced
{target namespace}referenced
Model Group
{particles}traversed *
{annotation}traversed (special)
{compositor}referenced
Particle
{term}traversed *
{min occurs}none
{max occurs}none
Wildcard
{annotation}traversed (special)
{namespace constraint}none
{process contents}none
Identity-constraint Definition
{annotation}traversed (special)
{name}referenced
{target namespace}referenced
{identity-constraint category}none
{selector}none
{fields}none
{referenced key}traversed
Notation Declaration
{annotation}traversed (special)
{name}referenced
{target namespace}referenced
{public identifier}none
{system identifier}none
Annotation
{application information}none
{user information}none
{attributes}none
Schema
{type definitions}traversed
{attribute declarations}traversed
{element declarations}traversed *
{attribute group definitions}traversed
{model group definitions}traversed
{notation declarations}traversed
{identity constraint definitions}traversed
{annotations}traversed (special)
Simple Type Definition
{base type definition}traversed
{facets}traversed *
{fundamental facets}traversed
{item type definition}traversed
{member type definitions}traversed
{annotations}traversed (special)
{name}referenced
{target namespace}referenced
{variety}referenced
{final}none
{primitive type definition}traversed
Facets
{annotation}traversed (special)
{value}none
{fixed}none

B Glossary (Non-Normative)

The listing below is for the benefit of readers of a printed version of this document: it collects together all the definitions which appear in the document above.

absolute schema component designator
An absolute schema component designator consists of two parts: a designator for the assembled schema (a schema designator), and a designator for a particular schema component or schema components relative (a relative schema component designator) to that assembled schema.
ancestor set
The ancestor set of the target schema component is the set of schema components on the valid canonical path to the current schema component together with the current schema component.
axis
A traversal from one component to another takes place across some particular component property. This property is the axis of traversal.
base attribute use set
The base attribute use set of a schema component is the set consisting of all members of the {attribute uses} property of members of the base type set of that schema component.
base facet set
The base facet set of a schema component is the set consisting of all members of the {facets} property of members of the base type set of that schema component.
base particle set
The base particle set of a schema component is the union of all particle sets of all the members of the extended base type set of that schema component.
base type set
The base type set of a schema component is the set consisting of the {base type definition} of that schema component and the {base type definition} of every member of the set.
canonical schema component designator
A canonical schema component designator is an absolute schema component designator that is a URI that has been normalized according to the rules given in the update to RFC2396 and where the relative schema component designator consists of an xmlns XPointer pointer part (if required) followed by a canonicalized xscd XPointer pointer part.
canonical schema component path
The canonical schema component path of a component is a distinguished valid component path that uniquely identifies that particular component, that has as few steps as possible, and that can be deterministically constructed.
canonicalized xscd XPointer pointer part
A canonicalized xscd XPointer pointer part is an xscd XPointer pointer part where the pointer data is a canonical schema component path.
component relationship
The component relationship is the name of the schema component property on the current schema component which references the target schema component.
current schema component
The current schema component is a schema component for which there is a valid canonical path through the schema component graph.
default axis
A default axis is a privileged axis of traversal.
extended base type set
The extended base type set of a schema component is the set consisting of the {base type definition} of that schema component if its {derivation} method is "extension" and the {base type definition} of every member of the set whose {derivation} method is "extension".
head steps
Head steps are a series of steps in a schema component path, begin with the first step and end with any step that is not the last step in a schema component path.
intermediate step
An intermediate step is a [step] piece that is neither the first step nor the last step in a schema component path.
particle set
The particle set of a schema component is the set consisting of the {content type} of that schema component with the members of the {particles} property of the {term} of any member of the set.
relative schema component designator
The relative schema component designator is an XPointer scheme xscd() that uses a schema component path as the scheme data.
same (attribute uses)
Two attribute uses are the same if the {name} and {target namespace} of their {attribute declaration} properties are equal.
same (facets)
Two facets are the same if they are the same kind of component (e.g. both are length facets) and their {value} properties have identical values.
same (particles)
Two particles are the same if the implementation reports them as the same.
schema component designators are equal
Two schema component designators are equal if they are absolute and their URIs are equal or if they are relative to the same schema, and their schema component paths are equal.
schema component path
A schema component path is a series of [step] pieces, each of which corresponds to a particular schema component along the path from the schema-as-a-whole schema component.
schema component paths are equal
Two schema component paths are equal if they have the same number of steps, and each step in one path is equal to the corresponding step in the other. Steps are equal if all of their properties have the same value.
schema designator
A schema designator is a single URI for a resource representing an assembled schema.
step
A [step] represents a schema component along the path from the schema-as-a-whole schema component. Each [step] has a possibly empty [target namespace], a possibly empty [name], and possible empty [predicate], a [schema component kind], and an [axis].
target schema component
The target schema component is a schema component linked to the current schema component via one of the schema component properties defined previously.

C References