Importing DTDs and TSD2 Schemas

This document covers the following topics:


Importing a DTD

You can import a DTD and thus convert it to a Tamino schema.

The imported DTD is written to the schema which is currently shown in the Tamino Schema Editor. This may be either an existing schema or an empty schema that you have just created using the New command. In the latter case, the DTD name is automatically used as the schema name.

Since a Tamino schema can contain several doctypes, you can read multiple DTDs into the same schema.

A DTD file, patient.dtd, is provided for testing purposes. See Examples, The Patient Database in the Tamino XML Server documentation for further information.

Note:
The DTD-to-TSD conversion can also be run using a command line tool. See Command Line Tools for Schema Conversions.

Start of instruction setTo import a DTD

  1. Make sure that the required schema (either an empty schema or an existing schema) is shown in the Tamino Schema Editor.

  2. From the File menu, choose Import DTD.

    The Import DTD dialog box appears.

  3. Browse to the drive and folder containing the required DTD and select the DTD.

  4. Choose the Import button.

    The DTD is imported and shown in the schema tree. If the DTD is imported into an existing schema, it is inserted at the end of the schema tree.

    The converter scans the DTD, declares the DTD elements globally, and then builds the schema structure, generating references to the global elements.

    To inspect the new schema, you can switch to code view. You will see that the converter has generated a skeleton schema that conforms to the XML Schema (logical properties) below the doctype declaration, that is, without any physical properties.

    If an element cannot be converted (for example, an entity), the converter writes a comment into the code.

    Caution:
    If you wish instances of the new Tamino schema to conform to the original DTD, you should not change any of the logical properties name, Minimum occurrence, Maximum occurrence or Mixed content.

  5. Select the nodes that you want to map to the Tamino schema and define their physical properties.

    For a description of all available properties, see Properties Explained.

    Tip:
    When an element declaration or element reference is selected in the schema tree, you can use the following commands from the Edit menu: Go to Declaration and Go to Reference.

  6. Declare the Tamino doctype. To do so, select the schema node and from the Insert menu, choose doctype.

    A new doctype with the name "NEW_doctype" is now shown in the tree.

  7. Specify a name for the new doctype. It must be the same name as that of the top-level DTD element.

  8. Define/update the current schema in Tamino and/or save it in your file system.

    See Defining and Saving Schemas.

Importing a TSD2 Schema

You can import a TSD2 schema and thus convert it to the schema definition language which is supported by the current version of Tamino. See also Migration Guide in the Tamino XML Server documentation.

The imported TSD2 schema is written to the schema which is currently shown in the Tamino Schema Editor. This may be either an existing schema or an empty schema that you have just created using the New command.

Note:
The DTD-to-TSD conversion can also be run using a command line tool. See Command Line Tools for Schema Conversions.

Start of instruction setTo import a TSD2 schema

  1. Make sure that the required schema (either an empty schema or an existing schema) is shown in the Tamino Schema Editor.

  2. From the File menu, choose Import TSD2 Schema.

    The Import TSD2 Schema dialog box appears.

  3. Browse to the drive and folder containing the required TSD2 schema and select the schema.

    Note:
    TSD2 schema files have the extension "xml".

  4. Select the encoding with which the imported schema is to be saved.

    The encoding is written to the XML declaration of the schema file. The default encoding is "platform".

    Note:
    The Encoding drop-down list box is editable.

  5. Select the conversion mode: loose or strict.

    Use the default mode (loose) unless you know for sure that your instances will validate against the Tamino schema generated in strict mode. In other words, if the TSD2 schema originates from a DTD and the instances validate against that DTD, convert using strict mode. In all other cases, use loose mode.

  6. Choose the Import button.

    The TSD2 schema is imported and shown in the schema tree. If the TSD2 schema is imported into an existing schema, it is inserted at the end of the schema tree.

  7. Define/update the current schema in Tamino and/or save it in your file system.

    See Defining and Saving Schemas.