Hello,

On 11/05/2002 06:44 PM, Bernardo De Barros Franco wrote:
I've recently tried to find info about creating databases from XML files and
didn't find anything. Since there is no php.XML I'm posting it in the
general section.
Does anyone know where I can find PHP source code that will parse an XML
file and generate SQL queries that would create tables based on the
structure described on the XML?
Something like:
xml = "
<Database name='db1'>
   <Table name='Table1'>
      <Attribute name='foo1' type='int4' />
    </Table>
</Database>
";
and some function func(xml) would return a set of SQL queries that would
create that database in a particular DB (say PostgreSQL or MySQL).
Anything similar would help already.
Metabase does that and much more. It installs a schema from a description in XML of tables, fields, indexes and sequences.

If you change that schema, it is capable of figuring the changes and performing the alterations without disturbing the data that has been added to the database since the database was installed for the first time or installed for the last time.

Metabase is Open Source and is available here:

http://www.phpclasses.org/metabase

--

Regards,
Manuel Lemos


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to