in reply to DBMS<=>XML

I suspect you should share some examples of the variety of schemas you expect to handle. This problem is just going to devolve into a xml schema problem so if you ignore the DBI part you'll be off on a right foot.

Replies are listed 'Best First'.
Re: Re: DBMS<=>XML
by rvosa (Curate) on May 04, 2004 at 00:00 UTC
    Here's an example of a submission of data:
    <?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE cipresml SYSTEM "cipres.dtd"> <cipresml version="0.0.1" sessionID="1" status="0" user="rvosa" servic +e="Repository"> <submission> <taxa tBID="Taxablock"> <taxon tID="taxonID"> <name>taxon name</name> </taxon> </taxa> </submission> </cipresml>
    In this case there are three tables involved: the sessions table (which stores the sessionID, the username and a timestamp), the taxa table (which stores the tBID, and the sessionID as a foreign key) and the taxon table (which stores the tID, the name, the tBID and the sessionID - the last two are foreign keys referencing the taxa table).

    Here's an example of a query, in SQL, that I want to result in a structure like that descending from the <submission> element:
    SELECT name FROM taxon WHERE tBID='Taxablock' AND sessionID=1 AND tID= +'taxonID';

      Is that the only style of submission you'll get? You implied that your interpreter was going to have to intuit what the submission means. This may be a stupid question but can't you get a meaningful specification for the schemas you'll be expected to consume? From there you just note which schema style was retrieved and use an output reformatter that writes to that style. Also, have you looked at XQuery? I've heard of it in similar contexts except that it may be already designed to handle the problems you're just going to have to invent around.

        Is that the only style of submission you'll get? You implied that your interpreter was going to have to intuit what the submission means.

        The submissions aren't the problem. The data is highly structured and quite variable but entering data into the database works just fine. There are ways to automate this too using a map, but I'm using XML::Twig to put everything where it's supposed to go and there's no problems there, really.
Re: Re: DBMS<=>XML
by mifflin (Curate) on May 04, 2004 at 04:03 UTC
    I think the w3c has a spec for sql and xml called xsql.
    There is also some perl related development going on with this
    see the following link...
    perl xsql info
      I think the w3c has a spec for sql and xml called xsql.

      Thanks for the heads up, looking into this now...