Stylus Studio XML Editor

Table of contents

Appendices

E.2 RELAX NG

RELAX NG

A RELAX NG schema may be used as the schema language for WSDL. It may be embedded or imported; import is preferred. A namespace must be specified; if an imported schema specifies one, then the [actual value] of the namespace attribute information item in the import element information item must match the specified namespace. RELAX NG provides both type and element definitions. The following discussion supplies the prefix rng which is mapped to the URI "http://www.relaxng.org/ns/structure/1.0".

Importing RELAX NG[top]

Importing RELAX NG

Importing a RELAX NG schema uses the rng:include mechanism defined by RNG, with restrictions on its syntax and semantics. A child element information item of the types element information item is defined with the Infoset properties as follows:

  • A [local name] of include.

  • A [namespace name] of "http://www.relaxng.org/ns/structure/1.0".

  • Two attribute information items as follows:

    • A ns attribute information item as described below.

    • A href attribute information item as described below.

    • Additional attribute information items as defined by the RNG specification.

Note that WSDL restricts the rng:include element information item to be empty. That is, it cannot redefine rng:start and rng:define element information items; it may be used solely to import a schema.

ns attribute information item[top]

ns attribute information item

The ns attribute information item defines the namespace of the type and element definitions imported from the referenced schema. If the referenced schema contains an ns attribute information item on its grammar element information item, then the values of these two attribute information items must be identical. If the imported grammar does not have an ns attribute information item then the namespace specified here is applied to all components of the schema as if it did contain such an attribute information item. The ns attribute information item contains the following Infoset properties:

  • A [local name] of ns.

  • A [namespace name] which has no value.

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

href attribute information item[top]

href attribute information item

The href attribute information item must be present, according to the rules of the RNG specification. However, WSDL allows it to be empty, and considers it only a hint. Caching and cataloging technologies may provide better information that this hint. The href attribute information item has the following Infoset properties:

  • A [local name] of href.

  • A [namespace name] that has no value.

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

Embedding RELAX NG[top]

Embedding RELAX NG

Embedding an RNG schema uses the existing top-level rng:grammar 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 rng:grammar element information item has the following Infoset properties:

  • A [local name] of grammar.

  • A [namespace name] of "http://www.relaxng.org/ns/structure/1.0".

  • An ns attribute information items as described below.

  • Additional attribute information items as specified for the rng:grammar element information item in the RNG specification.

  • Child element information items as specified for the rng:grammar element information item in the RNG specification.

ns attribute information item[top]

ns attribute information item

The ns attribute information item defines the namespace of the type and element definitions embedded in this schema. WSDL modifies the RNG definition of the rng:grammar element information item to make this attribute information item required. The ns attribute information item has the following infoset properties:

  • A [local name] of ns.

  • A [namespace name] that has no value.

The type of the ns 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 rng:define definition may be referenced from the part element information item using the type attribute information item. The QName is constructed from the namespace (ns attribute information item) of the schema and the content of the name attribute information item of the define attribute information item. A type attribute information item may not be used to refer to an rng:element element information item.

A named Relax NG element definition may be referenced from the part element information item using the element attribute information item. The QName is constructed from the namespace (ns attribute information item) of the schema and the content of the name attribute information item of the element element information item An element attribute information item may not be used to refer to an rng:define element information item.