Stylus Studio XML Editor

Table of contents

Appendices

3.1 Using W3C XML Schema Description Language

Using W3C XML Schema Description Language

XML Schema MAY be used as the schema language, via import or embedding. Each method defines a different element information item. All processors MUST support XML Schema type definitions.

Importing XML Schema[top]

Importing XML Schema

Importing an XML Schema uses the xs:import mechanism defined by XML Schema[XMLSchemaP1],[XMLSchemaP2], with its syntax and semantics, plus some restrictions. A child element information item of the types element information item is defined with the Infoset properties as follows:

  • A [local name] of import.

  • A [namespace name] of "http://www.w3.org/2001/XMLSchema".

  • One or two attribute information items as follows:

    • A namespace attribute information item as described below.

    • An optional schemaLocation attribute information item as described below.

namespace attribute information item[top]

namespace attribute information item

The namespace attribute information item defines the namespace of the type and element definitions imported from the referenced schema. If the referenced schema contains a targetNamespace attribute information item on its xs:schema element information item, then these values of these two attribute information items MUST be identical. If the schema does not have a targetNamespace attribute information item, then the namespace specified by the namespace attribute information item is applied to all components of the schema as if it contained a corresponding targetNamespace declaration. The namespace attribute information item has the following Infoset properties:

  • A [local name] of namespace

  • A [namespace name] which has no value.

The type of the namespace attribute information item is xs:anyURI.

schemaLocation attribute information item[top]

schemaLocation attribute information item

The schemaLocation attribute information item, if present, provides a hint to the processor as to where the schema may be located. Caching and cataloging technologies may provide better information than this hint. The schemaLocation attribute information item has the following infoset properties:

  • A [local name] of schemaLocation.

  • A [namespace name] that has no value.

The type of the schemaLocation attribute information item is xs:anyURI.

Embedding XML Schema[top]

Embedding XML Schema

Embedding an XML schema uses the existing top-level xs:schema element information item. It may be viewed as simply cutting and pasting an existing, stand-alone schema, to a location inside the Types Component. The xs:schema element information item has the following Infoset properties:

  • A [local name] of schema.

  • A [namespace name] of "http://www.w3.org/2001/XMLSchema".

  • A targetNamespace attribute information item, amongst its [attributes] as described below.

  • Additional attribute information items as specified for the xs:schema element information item in the XML Schema specification.

  • Child element information items as specified for the xs:schema element information item in the XML Schema specification.

targetNamespace attribute information item[top]

targetNamespace attribute information item

The targetNamespace attribute information item defines the namespace of the type and element definitions embedded in this schema. WSDL modifies the XML Schema definition of the xs:schema element information item to make this attribute information item required. The targetNamespace attribute information item has the following infoset properties:

  • A [local name] of targetNamespace.

  • A [namespace name] that has no value.

The type of the targetNamespace attribute information item is xs:anyURI.

References to Type and Element Definitions[top]

References to Type and Element Definitions

Whether embedded or imported, the type and element definitions present in a schema may be referenced from a message part.

A named, global xs:simpleType or xs:complexType definition may be referenced from the part element information item using the type attribute information item. The QName is constructed from the targetNamespace of the schema and the content of the name attribute information item of the simpleType or complexType element information item. A type attribute information item may not be used to refer to an xs:element element information item.

A named, global xs:element definition may be referenced from the part element information item using the element attribute information item. The QName is constructed from the targetNamespace of the schema and the content of the name attribute information item of the xs:element element information item. An element attribute information item may not be used to refer to an xs:simpleType or xs:complexType element information item.