>I wonder whether there has a way to generate the data
>schema of relational database automatically from a
>given DTD file. For example, if I give a DTD file, it
>is possible to automatically convert into the data
>schema of tables of a database.
>Because DTD is semi-structure, and the data schema of
>relational database is relational, it will be a good
>idea to have a parser to parse DTD file judging that
>it is possible to generate relational database table
>schema. I wonder whether there have some web sites
>related on it?
This is possible. For a summary of the general algorithm, see section 4.4
(Generating DTDs from Database Schema and Vice Versa) of the paper "XML and
Databases" . Note that this algorithm models the XML document as a tree
of data-specific objects. This is the second of the two models described in
section 4.2.2 of the same paper.
I have implemented this algorithm -- parsing a DTD and generating database
schema from it -- in XML-DBMS . See the GenerateMap sample for details.
(Note that I have not yet implemented the reverse -- generating a DTD from a
>In addition, if there have XLink or XPoint, how they
>cab be convert into the corresponding data schema of a
Do you mean translating XLinks into primary key/foreign key relationships in
the database? This would be cool if you could do it. Note that to do this,
you would need the schemas (DTDs) of both the pointed from and pointed to
documents, so that you could generate the necessary columns, and the
documents themselves, so you could put the correct data in the columns. My
guess is that the second part is non-trivial...
-- Ron Bourret
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com