Dia XML format information



Hi,

 

Today I begin to write code to convert a Dia schema based uppon Database and References to SQL.

For the moment it work perfectly with tables and attributes of tables (fields names and types) when parsing all Database – Table objects.

 

Now I would like to get all the foreign keys, so I try to parse all [Database – Reference] object nodes ( <dia:object type="Database - Reference" …)

And I’m a little bit confused with  the [dia:connection].

I can find the tables witch are linked but not the field.

 

By example, for a reference i get this connections information :

      <dia:connections>

        <dia:connection handle="0" to="O29" connection="15"/>

        <dia:connection handle="1" to="O37" connection="13"/>

      </dia:connections>

 

So I know the foreign key start from table with id O29 and point to table with id O37 but what is the meaning of « connection »  (15 and 13 in this case) ?

 

I would like to know

from which table field to which table field

For the moment I only have

from which table to which table

 

and of course it’s not enough to generate SQL code.

 

Can you give me the method to translate the [connection="15"] and the [connection="13"] to the corresponding field of a table object ?

What I’ve missed ?

 

Thank you for your answer,

SteF.

 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]