in reply to Re: DBMS<=>XML
in thread DBMS<=>XML

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';

Replies are listed 'Best First'.
Re: Re: Re: DBMS<=>XML
by diotalevi (Canon) on May 04, 2004 at 00:11 UTC

    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.