Stylus Studio XML Editor

Table of contents

Appendices

2.6 Schema-Related Markup in Documents Being Validated

Schema-Related Markup in Documents Being Validated

The XML representation of schema components uses a vocabulary identified by the namespace name http://www.w3.org/2001/XMLSchema. For brevity, the text and examples in this specification use the prefix xs: to stand for this namespace; in practice, any prefix can be used.

XML Schema: Structures also defines several attributes for direct use in any XML documents. These attributes are in a different namespace, which has the namespace name http://www.w3.org/2001/XMLSchema-instance. For brevity, the text and examples in this specification use the prefix xsi: to stand for this latter namespace; in practice, any prefix can be used. All schema processors have appropriate attribute declarations for these attributes built in, see [Attribute Declaration for the 'type' attribute], [Attribute Declaration for the 'nil' attribute], [Attribute Declaration for the 'schemaLocation' attribute] and [Attribute Declaration for the 'noNamespaceSchemaLocation' attribute].

xsi:type[top]

xsi:type

The [Simple Type Definition] or [Complex Type Definition] used in valid of an element is usually determined by reference to the appropriate schema components. An element information item in an instance may, however, explicitly assert its type using the attribute xsi:type. The value of this attribute is a QName; see [QName Interpretation] for the means by which the QName is associated with a type definition.

xsi:nil[top]

xsi:nil

XML Schema: Structures introduces a mechanism for signaling that an element should be accepted as valid when it has no content despite a content type which does not require or even necessarily allow empty content. An element may be valid without content if it has the attribute xsi:nil with the value true. An element so labeled must be empty, but can carry attributes if permitted by the corresponding complex type.

xsi:schemaLocation, xsi:noNamespaceSchemaLocation[top]

xsi:schemaLocation, xsi:noNamespaceSchemaLocation

The xsi:schemaLocation and xsi:noNamespaceSchemaLocation attributes can be used in a document to provide hints as to the physical location of schema documents which may be used for assessment. See [How schema definitions are located on the Web] for details on the use of these attributes.