This document covers the following topics:
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
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.
To import a DTD
Make sure that the required schema (either an empty schema or an existing schema) is shown in the Tamino Schema Editor.
From the
menu, choose .The Import DTD dialog box appears.
Browse to the drive and folder containing the required DTD and select the DTD.
Choose the
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
.
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
menu: and
.
Declare the Tamino doctype. To do so, select the schema node and from the
menu, choose .A new doctype with the name "NEW_doctype" is now shown in the tree.
Specify a name for the new doctype. It must be the same name as that of the top-level DTD element.
Define/update the current schema in Tamino and/or save it in your file system.
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
command.Note:
The DTD-to-TSD conversion can also be run using a command line tool.
See Command Line Tools for
Schema Conversions.
To import a TSD2 schema
Make sure that the required schema (either an empty schema or an existing schema) is shown in the Tamino Schema Editor.
From the
menu, choose .The Import TSD2 Schema dialog box appears.
Browse to the drive and folder containing the required TSD2 schema and select the schema.
Note:
TSD2 schema files have the extension
"xml".
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.
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.
Choose the
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.
Define/update the current schema in Tamino and/or save it in your file system.
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
command.Important:
The ODBC Wizard can only be used if the appropriate ODBC driver
for the external data source has been installed.
To import an SQL schema using the ODBC Wizard
Make sure that the required schema (either an empty schema or an existing schema) is shown in the Tamino Schema Editor.
If you want to import an SQL schema into an existing schema, select the element below which the SQL schema is to be inserted.
From the
menu, choose .This command is only available, if the current selection in the tree allows the insertion of an SQL schema.
Enter the ODBC DSN (Data Source Name) in the appropriate text box.
If your database requires security information, enter your user ID and password in the appropriate text boxes.
Choose the
button.The next dialog of the ODBC Wizard appears, providing a tree view of the database and its tables.
Expand the nodes in the tree and select the table you want to map.
Choose the
button.The next dialog of the ODBC Wizard appears, listing each column of the previously selected table with its name and data type.
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.
Choose the
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.
Select the check box for each column that you want to use for generating the sub-tree.
You can also use the
or button.The primary key cannot be changed in this dialog.
Choose the
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).