Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Using XML and a relational database

Re: Using XML and a relational database

From: Alex Shirshov <nomail_at_mail.ru>
Date: Thu, 28 Oct 2004 18:32:02 +0400
Message-ID: <eWcNirPvEHA.4028@TK2MSFTNGP15.phx.gbl>


Hello, Lemming!
You wrote on Thu, 28 Oct 2004 11:49:51 +0100:

[Sorry, skipped]

??>> Don't be conning! Yes, xml docs with the regular form can be
??>> transformed to relational structure, but this is the only one case.
??>> The app need to be able to work with ustructured and semistructured
??>> xml documents and this is the primary use case. If you said, that xml
??>> docs without regular structure also can be easily transformed to
??>> relational form, than i will dare to claim you are not working with
??>> RDBMS. It's not easy to alter table each time you partner adds another
??>> extensibility element to your wonderful, semirelational xml format.

 L> Nor is it easy to amend the programs which consume the wonderful[1],
 L> semi-relational xml format.  My current client has a so-called
 L> "partner" who every week or two will send xml files containing new
 L> elements and/or attributes without telling my client's development
 L> team beforehand, and then can't understand why the files can't be
 L> processed.

You client is right (as always). Formats are changing and your processors should be able to work with new documents. There is a great articles about xml formats evolution: Versioning XML Vocabularies and Designing Extensible, Versionable XML Formats.
Versioning is the complex problem which involve both a good design of xml format and a good processor implementation. You should allow extensibility points and be ready to work with them. Otherwise you've got the headache indifferently the storage.
My point of view is that it is very complicated to store "versionable" xml in relational form, because you don't know what to do with unknown attributes and elements. There is not mapping for them! Therefore you have to store those unknown fragments as plain text. Or as xml date type. I choose the latter.

 L> The fact that xml is a chaotic, unstructured, bloated mess and that
 L> even apparently experienced xml-oriented developers can't understand
 L> that changing their file format has an impact on others is not the
 L> fault of the RDBMS.

I didn't claim that, the impossibility of RDBMS to work with xml is its fault. I claim, that RrrrrrDBMS eminently suitable for rrrrrelational structures, but not the "chaotic, unstructured and bloated mess" data. It is not its fault, it is behavior by design. I think it is better to use XPath or XQuery and native xml, than

1. transform data to relational form
2. query them
3. transform date to xml form

Note, that you also have to prepare for "relational approach" by creating tables for xml representation.

With best regards, Alex Shirshov. Received on Thu Oct 28 2004 - 09:32:02 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US