Tamino XML Server Version 9.7
 —  Tamino XML Schema User Guide  —

Introduction

Tamino is an XML-based information server that can manage all types of data. For data storage, Tamino offers its own internal XML store; in addition, Tamino offers the X-Node interface to Software AG's Adabas.

A Tamino schema:

This introduction gives an overview of the issues involved in defining a Tamino schema. It is organized under the following headings:


What is a Schema?

In general, a schema is a description of the structure of XML data. As stated above, a schema is necessary for much of Tamino's functionality, because in many situations Tamino needs to know how or where data is stored in order to perform its tasks optimally.

To express a schema, we need a schema definition language that embraces all the rules necessary for schema definition. For XML, several schema definition languages exist. The most commonly used schema definition languages are:

Although DTDs are still often used to express the structure of an XML document, the newer and more powerful XML Schema standard that was defined by the W3C is the current schema standard.

Top of page

The XML Schema Recommendation from the W3C

This section explains the XML Schema standard, which is maintained by the W3C (World Wide Web Consortium). This standard has evolved to be the most important schema standard beside Document Type Definitions (DTD). Because it is more powerful than DTD, it can be considered as the most important standard for schema definition. Therefore Software AG decided to use XML Schema as the basis for the Tamino schema definition language (TSD).

W3C Documentation for XML Schema

The official XML Schema documentation is divided into three parts:

XML Schema Part 0: Primer

A non-normative introduction to XML Schema explaining the general concepts of XML Schema. It is recommended that you read this document first if you are completely new to XML Schema. It is easier to understand than the other two.

XML Schema Part 1: Structures

The part of the normative documents that describes structures. It explains the facilities that the XML Schema standard offers for describing the structure and constraining the contents of XML 1.0 documents. The schema language considerably extends the capabilities found in DTD.

XML Schema Part 2: Datatypes

The part of the normative documents that describe the facilities for defining datatypes for XML schemas. It explains the facilities for defining datatypes to be used in XML schemas as well as other XML specifications that exceed the possibilities provided by DTDs by far.

Other Sources of Information on the W3C XML Schema

The following are some non-W3C resources on XML Schema:

Top of page

Advanced Tamino Schema Language Based on W3C Standard

The schema language that is implemented in Tamino has been progressively developed, so that it now almost completely covers the XML Schema language as defined by the W3C, with Tamino-specific extensions. This special subset of XML Schema has been customized for Tamino to express (nearly) all DTD capabilities in XML Schema syntax plus the most important features for storing XML data.

In Tamino, you define a schema by the following two-step procedure:

Start of instruction setTo define a schema

  1. Specify the structural information of the schema using the XML Schema language. This can, for example, be done with the Tamino Schema Editor. If you already have a DTD describing your doctype, the Tamino Schema Editor can convert it into a TSD Schema. Otherwise, you must write the XML Schema from scratch.

    This is done using the logical part of TSD.

    The appropriate elements of the logical part of the TSD are described in the sections The Logical Schema, Tamino-Specific Extensions to the Logical Schema and TSD Logical: Definitions.

  2. Specify physical storage information (for example, for mapping and indexing) using the Tamino-specific extensions to XML Schema.

    This is done using the physical part of TSD.

    The appropriate elements of the physical part of the TSD are described in the sections Tamino-Specific Extensions to the Physical Schema and Tamino Extensions to XML Schema: List of Elements and Attributes.

For more information, see the section Creating a Schema.

For an overview of the Tamino schema elements and attributes, see the Tamino XML Schema Reference Guide.

TSD implements all features of the W3C XML Schema with the following exceptions:

See also the section Features of the W3C XML Schema that are Not Supported by Tamino.

Example

The following figure illustrates the schema of a patient record (doctype "patient") in a hospital database:

graphics/patient.gif

This tree structure can be represented by the following XML schema, which contains only structural information:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <!-- Schema for patient data.
       This could be a fragment of a larger DTD modeling hospital data -->
  <xs:element xs:name='patient'>
    <xs:complexType>
      <xs:sequence>
        <xs:element xs:ref='name' xs:minOccurs='0' />
        <xs:element xs:ref='address' xs:minOccurs='0' />
      </xs:sequence>
      <xs:attribute xs:name='ID' xs:type='xs:string' xs:use='optional' />
    </xs:complexType>
  </xs:element>
  <xs:element xs:name='name'>
    <xs:complexType>
      <xs:sequence>
        <xs:element xs:ref='surname' />
        <xs:element xs:ref='firstname' />
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element xs:name='surname' xs:type='xs:string' />
  <xs:element xs:name='firstname' xs:type='xs:string' />
  <xs:element xs:name='address'>
    <xs:complexType>
      <xs:sequence>
        <xs:element xs:ref='street' xs:minOccurs='0' />
        <xs:element xs:ref='housenumber' xs:minOccurs='0' />
        <xs:element xs:ref='city' xs:minOccurs='0' />
        <xs:element xs:ref='postcode' xs:minOccurs='0' />
        <xs:element xs:ref='country' xs:minOccurs='0' />
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element xs:name='street' xs:type='xs:string' />
  <xs:element xs:name='housenumber' xs:type='xs:string' />
  <xs:element xs:name='city' xs:type='xs:string' />
  <xs:element xs:name='postcode' xs:type='xs:string' />
  <xs:element xs:name='country' xs:type='xs:string' />
</xs:schema>

Top of page

Fundamentals of Tamino Schema Definition

Conventions Used in this Document

The following prefixes are used for namespaces that occur frequently throughout this documentation:

The xs:annotation/xs:appinfo Mechanism for Adding Tamino-Specific Extensions

The XML Schema Recommendation allows any schema document to be extended by arbitrary content in xs:annotation and xs:appinfo elements that are children of any other element defined by XML Schema.

TSD takes advantage of this feature by adding elements tsd:schemaInfo, tsd:elementInfo and tsd:attributeInfo as children of the xs:schema, xs:element and xs:attribute elements respectively. These extensions belong to the namespace http://namespaces.softwareag.com/tamino/TaminoSchemaDefinition. Only one tsd:schemaInfo, tsd:elementInfo or tsd:attributeInfo element is allowed for each schema, element or attribute definition respectively.

Example Schema

The following Tamino schema code snippet illustrates how this mechanism can be used to incorporate schema-related information in the xs:schema element:

<?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">
  <xs:annotation>
    <xs:appinfo>
      <tsd:schemaInfo name = "patient">
        <tsd:collection name = "hospital"/>
      </tsd:schemaInfo>
    </xs:appinfo>
  </xs:annotation>
  .
  .
  .
</xs:schema>

Example Element

Tamino-related extensions attached to a single element are specified as illustrated in the following example:

<xs:element name="surname">
  <xs:annotation>
    <xs:appinfo>
      <tsd:elementInfo>
        .
        .
        .
      </tsd:elementInfo>
    </xs:appinfo>
  </xs:annotation>
  .
  .
  .
</xs:element>

Example Attribute

Tamino-related extensions attached to a single attribute are specified as illustrated in the following example:

<xs:attribute name="value">
  <xs:annotation>
    <xs:appinfo>
      <tsd:attributeInfo>
        .
        .
        .
      </tsd:attributeInfo>
    </xs:appinfo>
  </xs:annotation>
  .
  .
  .
</xs:attribute>

For more information concerning this topic, please refer to the following:

Meta Schema

The Tamino Schema Definition Language is defined by a meta schema, or schema of schemas, which is based on a subset of the W3C XML Schema standard. The TSD meta schema, i.e. the schema of schemas, can itself be expressed in terms of XML Schema.

Limitations on the Lengths of Names

The following applies:

The following restriction on the lengths of names apply:

Top of page

Creating a Schema

Defining a schema for storing data in Tamino means choosing the kind of storage (for example, native or non-XML storage or mapping to Adabas, Server Extension) and determining the kind of indexing to be performed on the data. Additionally, triggers and unique constraints can be defined. Normally, you should choose native storage to take advantage of the full power of Tamino.

However, there is more than one way to store an XML object in Tamino's XML store. You can:

See also the section Tools for the Creation of Tamino Schemas.

Top of page

Further Documentation

The documentation of the TSD language comprises the section you are currently reading and the Tamino XML Schema Reference Guide, which describes each element of the language.

Related documentation

Top of page