Tamino Schema Editor Version 9.7
 —  Tamino Schema Editor  —

Importing DTDs, TSD2 Schemas and SQL 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.

Top of page

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.

Top of page

Importing an SQL Schema Using the ODBC Wizard

You can import a schema from an external data source and thus convert it to a Tamino schema or schema sub-tree. The ODBC Wizard guides you in mapping SQL tables to a Tamino schema.

The imported SQL 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.

Important:
The ODBC Wizard can only be used if the appropriate ODBC driver for the external data source has been installed.

Start of instruction setTo import an SQL schema using the ODBC Wizard

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

  2. If you want to import an SQL schema into an existing schema, select the element below which the SQL schema is to be inserted.

  3. From the Tools menu, choose ODBC Wizard.

    This command is only available, if the current selection in the tree allows the insertion of an SQL schema.

    The first dialog of the ODBC Wizard appears.

  4. Enter the ODBC DSN (Data Source Name) in the appropriate text box.

  5. If your database requires security information, enter your user ID and password in the appropriate text boxes.

  6. Choose the Next button.

    The next dialog of the ODBC Wizard appears, providing a tree view of the database and its tables.

  7. Expand the nodes in the tree and select the table you want to map.

  8. Choose the Next button.

    The next dialog of the ODBC Wizard appears, listing each column of the previously selected table with its name and data type.

  9. Select the check box for the column that is used as the primary key.

    The primary key may already be selected. This depends on the ODBC driver that you are using.

  10. Choose the Next button.

    The next dialog of the ODBC Wizard appears, listing each column of the table with its name and data type. It also shows the previously selected primary key.

  11. Select the check box for each column that you want to use for generating the sub-tree.

    You can also use the Select All or Deselect All button.

    The primary key cannot be changed in this dialog.

  12. Choose the Finish button.

    The sub-tree is generated at the position that has previously been selected in the schema tree.

    You can now view the properties of the schema and of each node. For a description of all available properties, see Properties Explained.

Note:
For further information on mapping to SQL tables and columns, refer to Mapping to SQL Tables and Columns in the Tamino XML Schema User Guide (located in the Tamino XML Server documentation).

Top of page