The Schema Header

All information relevant to the description of a schema that cannot be expressed in the xs: namespace is located in the tsd:schemaInfo element of TSD and its subtree. This is also called the "schema header". The tsd:schemaInfo element is embedded into the xs:appinfo element (this is explained in the section The xs:annotation / xs:appinfo Mechanism for Adding Tamino-Specific Extensions).

The following diagram illustrates the content model of the tsd:schemaInfo element used under the xs:annotation and xs:appinfo elements:

graphics/schemaInfo.gif

Note:
The illustrated tsd:schemaInfo element is located under the xs:appinfo and xs:annotation elements directly under the top-level xs:schema element in the XML Schema syntax.

In detail, tsd:schemaInfo contains:

  • The name attribute.
    The meaning of this attribute differs slightly depending on its context:

    In the context of tsd:schemaInfo

    When used with the tsd:schemaInfo element, the value of this attribute is the name of the schema. For a more detailed description, see the documentation of the tsd:schemaInfo element.

    In the context of tsd:collection

    See below under The tsd:collection Child Element.

    In the context of tsd:doctype

    See below under The tsd:doctype Child Element.

  • The tsd:collection Child Element
    The name attribute of the tsd:collection child element specifies the name of the collection to be used in cases where this name cannot be clearly determined. You can also decide at this point whether an explicit schema is required when processing instances or not: see tsd:schema.

  • The tsd:doctype Child Element
    The tsd:doctype child element specifies the name of the Tamino doctype that the schema describes. It can also specify logical and physical storage options and special options for non-XML data. The doctype-specific logical storage options provided by this element include the choice between storage as open or closed content. The doctype-specific physical storage options include the possibility of creating a structure index and the "compress" option.

    A single schema can define multiple XML and non-XML doctypes.

  • The tsd:adminInfo Child Element
    The tsd:adminInfo child element contains administrative information that is associated with the current schema. This includes version information, creation date and modification date. This information is generated by Tamino when the schema is defined. It does not need to be maintained by the schema author.

  • The tsd:elementInfo Child Element
    The tsd:elementInfo child element contains information that describes an element in the sense of XML Schema, and also all relevant mapping or indexing information that is attached to this structural element. This includes both logical and physical information:

    The logical information included in the tsd:elementInfo element contains information about collation handling relevant to the schema, the definition of action triggers and functions that generate default values. For more information, see the respective sections of this document.

    The physical information relates to indexing, native and external mapping and object referencing, i.e. linking of different elements. In addition, the tsd:which element allows you to define an access path in situations where multiple paths are possible. For more information, see the section Elements and Attributes of this documentation.

    graphics/TSD3phys-elemInfo.gif

  • The tsd:attributeInfo Child Element
    The tsd:attributeInfo element contains both logical and physical information that describes an attribute in the sense of XML Schema.

    Similarly to the tsd:elementInfo element, both logical and physical information is included in the tsd:attributeInfo element. The information about mapping, indexing and object referencing given in the section Elements and Attributes of this documentation also applies to attributes.

    graphics/TSD3phys-attrInfo.gif

Example for a Schema Header

The following example shows a schema for storing data about hospital patients.

Note:
The full schema is given here. The start and end of the schema header are marked by comments.

<?xml version = "1.0" encoding = "UTF-8"?>
<xs:schema xmlns:xs = "http://www.w3.org/2001/XMLSchema"
           xmlns:tsd = "http://namespaces.softwareag.com/tamino/TaminoSchemaDefinition">
<!-- schema for patient data. This could be a fragment of a larger DTD
     modeling patient data in a hospital-->
<!-- Start of schema Header -->
  <xs:annotation>
    <xs:appinfo>
      <tsd:schemaInfo name = "patient-schema">
        <tsd:collection name = "Hospital"/>
        <tsd:doctype name = "patient"/>
      </tsd:schemaInfo>
    </xs:appinfo>
  </xs:annotation>
<!-- End of schema Header -->
...
</xs:schema>

Persistence of Schema Documents

Schema documents defined successfully to Tamino are stored in the doctype xs:schema in the collection ino:collection. Furthermore, a unique document name is generated for each schema document consisting of the collection name, a slash ("/") and the schema name. Thus, the schema given above could be retrieved from Tamino by using the following plain URL addressing:

http://node_name/tamino/dbname/ino:collection/xs:schema/Hospital/patient-schema

where node_name and dbname are placeholders for the nodename and the database name to be used, respectively.