Using XML and a relational database

Discussion in 'XML' started by comcast, Aug 30, 2003.

  1. comcast

    comcast Guest

    Hello all,
    I am developing an interface system for an application I was written. This
    interface will connect to other system to share information. I would like
    to use
    xml and xsl to generically describe each interface. The trouble I am having
    is that it seem that if you export in xml by table then it is impossible to
    combine the xml tables files back together in a hierarchical fashion. I can
    do it programmatically but I would like to do it with xsl so that knowledge
    of the database is not in the code but in the xsl. I can write generic code
    for dumping tables and sql statements. But formatting should be generic.
    Can this be done is xsl?
    comcast, Aug 30, 2003
    #1
    1. Advertising

  2. comcast

    Gregory Burd Guest

    On 2003-08-30 07:19:56 -0400, "comcast" <> said:

    > Hello all,
    > I am developing an interface system for an application I was written. This
    > interface will connect to other system to share information. I would like
    > to use
    > xml and xsl to generically describe each interface. The trouble I am having
    > is that it seem that if you export in xml by table then it is impossible to
    > combine the xml tables files back together in a hierarchical fashion. I can
    > do it programmatically but I would like to do it with xsl so that knowledge
    > of the database is not in the code but in the xsl. I can write generic code
    > for dumping tables and sql statements. But formatting should be generic.
    > Can this be done is xsl?



    Why are you using a relational database for XML? We have a native XML
    database that could solve your problems.

    -greg

    _____________________________________________________________________

    Gregory Burd
    Product Manager
    Sleepycat Software, Inc. http://www.sleepycat.com/
    Gregory Burd, Oct 20, 2004
    #2
    1. Advertising

  3. "Gregory Burd" <> wrote in message
    news:2004102017210016807%gburd@sleepycatcom...
    > Why are you using a relational database for XML? We have a native XML
    > database that could solve your problems.


    Because "XML database (native or not)" is misnomer?
    Mikito Harakiri, Oct 20, 2004
    #3
  4. comcast

    Lemming Guest

    On Wed, 20 Oct 2004 17:21:00 -0400, Gregory Burd <>
    wrote:

    >On 2003-08-30 07:19:56 -0400, "comcast" <> said:
    >
    >> Hello all,
    >> I am developing an interface system for an application I was written. This
    >> interface will connect to other system to share information. I would like
    >> to use
    >> xml and xsl to generically describe each interface. The trouble I am having
    >> is that it seem that if you export in xml by table then it is impossible to
    >> combine the xml tables files back together in a hierarchical fashion. I can
    >> do it programmatically but I would like to do it with xsl so that knowledge
    >> of the database is not in the code but in the xsl. I can write generic code
    >> for dumping tables and sql statements. But formatting should be generic.
    >> Can this be done is xsl?


    You are asking the wrong question. The question you should ask when
    considering XML for any task is always the same: "Is XML suited to
    this task?" The answer is also always the same: "No."

    >Why are you using a relational database for XML? We have a native XML
    >database that could solve your problems.


    Words fail me.

    Lemming
    --
    Curiosity *may* have killed Schrodinger's cat.
    Lemming, Oct 20, 2004
    #4
  5. comcast

    DA Morgan Guest

    Gregory Burd wrote:

    > Why are you using a relational database for XML? We have a native XML
    > database that could solve your problems.
    >
    > -greg
    >
    > _____________________________________________________________________
    >
    > Gregory Burd
    > Product Manager
    > Sleepycat Software, Inc. http://www.sleepycat.com/


    The only problems solved by an XML database are having too much unused
    disk space, too much bandwidth, too much scalability, and too much
    performance.

    I'll put money on every XML database company being out of busines within
    ten years. Or, perhaps optimistically, joining the large number of
    successful companies selling object databases.

    And thank you for posting to every usenet group you could spell.
    --
    Daniel A. Morgan
    University of Washington

    (replace 'x' with 'u' to respond)
    DA Morgan, Oct 22, 2004
    #5
  6. comcast

    Pat Guest

    "DA Morgan" <> wrote in message
    news:1098423328.126517@yasure...
    > Gregory Burd wrote:
    >
    > > Why are you using a relational database for XML? We have a native XML
    > > database that could solve your problems.
    > >
    > > -greg
    > >
    > > _____________________________________________________________________
    > >
    > > Gregory Burd
    > > Product Manager
    > > Sleepycat Software, Inc. http://www.sleepycat.com/

    >
    > The only problems solved by an XML database are having too much unused
    > disk space, too much bandwidth, too much scalability, and too much
    > performance.
    >
    > I'll put money on every XML database company being out of busines within
    > ten years. Or, perhaps optimistically, joining the large number of
    > successful companies selling object databases.
    >
    > And thank you for posting to every usenet group you could spell.
    > --
    > Daniel A. Morgan
    > University of Washington
    >
    > (replace 'x' with 'u' to respond)


    If that's the case and native XML databases no longer exist
    in this world (just like XQL?), will you perceive all XML,
    XSLT, XQuery, etc (what else?) just vanish?

    Just discussion.
    Pat, Oct 23, 2004
    #6
  7. comcast

    DA Morgan Guest

    Pat wrote:

    > "DA Morgan" <> wrote in message
    > news:1098423328.126517@yasure...
    >
    >>Gregory Burd wrote:
    >>
    >>
    >>>Why are you using a relational database for XML? We have a native XML
    >>>database that could solve your problems.
    >>>
    >>>-greg
    >>>
    >>>_____________________________________________________________________
    >>>
    >>>Gregory Burd
    >>>Product Manager
    >>>Sleepycat Software, Inc. http://www.sleepycat.com/

    >>
    >>The only problems solved by an XML database are having too much unused
    >>disk space, too much bandwidth, too much scalability, and too much
    >>performance.
    >>
    >>I'll put money on every XML database company being out of busines within
    >>ten years. Or, perhaps optimistically, joining the large number of
    >>successful companies selling object databases.
    >>
    >>And thank you for posting to every usenet group you could spell.
    >>--
    >>Daniel A. Morgan
    >>University of Washington
    >>
    >>(replace 'x' with 'u' to respond)

    >
    >
    > If that's the case and native XML databases no longer exist
    > in this world (just like XQL?), will you perceive all XML,
    > XSLT, XQuery, etc (what else?) just vanish?
    >
    > Just discussion.


    XML has value. XML databases are at best a niche like pure object
    databases and more likely a disaster.

    My main objection to XML in the database is the huge number of bytes
    required to store a single byte of data:

    <someridiculouslylongtag>1</someridiculouslylongtag>

    and then you get to push this to the app server and off to the client.
    XML was made for a purpose. It should be used for that purpose. Not
    kludged into every nook and crany imaginable.
    --
    Daniel A. Morgan
    University of Washington

    (replace 'x' with 'u' to respond)
    DA Morgan, Oct 23, 2004
    #7
  8. Hello, DA!
    You wrote on Sat, 23 Oct 2004 13:42:18 -0700:


    [Sorry, skipped]

    DM> XML has value. XML databases are at best a niche like pure object
    DM> databases and more likely a disaster.

    I want to store XML docs in DB avoiding file system, source control system,
    etc. How can I work with documents as xml, but not as CLOBs without a bare
    support of xml technologies in DBMS?

    DM> My main objection to XML in the database is the huge number of bytes
    DM> required to store a single byte of data:

    DM> <someridiculouslylongtag>1</someridiculouslylongtag>

    DM> and then you get to push this to the app server and off to the client.

    One remark - somenonsensicaltag is the part of the data, the same important
    as figure 1. And I don't think _any_ db won't optimize the storage to
    persist the name of the tag in only one instance.

    DM> XML was made for a purpose. It should be used for that purpose. Not
    DM> kludged into every nook and crany imaginable.

    XML is the text. It sure is better to keep the data of any type in DB, and
    xml is not an exception.

    With best regards, Alex Shirshov.
    Alex Shirshov, Oct 26, 2004
    #8
  9. comcast

    DA Morgan Guest

    Alex Shirshov wrote:

    > Hello, DA!
    > You wrote on Sat, 23 Oct 2004 13:42:18 -0700:
    >
    >
    > [Sorry, skipped]
    >
    > DM> XML has value. XML databases are at best a niche like pure object
    > DM> databases and more likely a disaster.
    >
    > I want to store XML docs in DB avoiding file system, source control system,
    > etc. How can I work with documents as xml, but not as CLOBs without a bare
    > support of xml technologies in DBMS?
    >
    > DM> My main objection to XML in the database is the huge number of bytes
    > DM> required to store a single byte of data:
    >
    > DM> <someridiculouslylongtag>1</someridiculouslylongtag>
    >
    > DM> and then you get to push this to the app server and off to the client.
    >
    > One remark - somenonsensicaltag is the part of the data, the same important
    > as figure 1. And I don't think _any_ db won't optimize the storage to
    > persist the name of the tag in only one instance.
    >
    > DM> XML was made for a purpose. It should be used for that purpose. Not
    > DM> kludged into every nook and crany imaginable.
    >
    > XML is the text. It sure is better to keep the data of any type in DB, and
    > xml is not an exception.
    >
    > With best regards, Alex Shirshov.


    The data can be easily stored in relational form and the XML
    reconstituted by either the database or by the app server. Benchmarks
    I've seen support the proposition that reconstitution on the app server
    gives the best overall performance.
    --
    Daniel A. Morgan
    University of Washington

    (replace 'x' with 'u' to respond)
    DA Morgan, Oct 28, 2004
    #9
  10. Hello, DA!
    You wrote on Wed, 27 Oct 2004 19:10:47 -0700:


    [Sorry, skipped]

    DM> The data can be easily stored in relational form and the XML
    DM> reconstituted by either the database or by the app server. Benchmarks
    DM> I've seen support the proposition that reconstitution on the app server
    DM> gives the best overall performance.

    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.
    I emphasize that storing semistructured xml documents into DB is the primary
    use case. And we should discuss the problem not only with relation to
    performance, but also extensibility, maintainability, complexity, etc.

    With best regards, Alex Shirshov.
    Alex Shirshov, Oct 28, 2004
    #10
  11. comcast

    HansF Guest

    Alex Shirshov wrote:

    >
    > I want to store XML docs in DB avoiding file system, source control
    > system, etc. How can I work with documents as xml, but not as CLOBs
    > without a bare support of xml technologies in DBMS?


    Just curious whether you have looked at the XMLType and the XML DB
    capability intrinsic to Oracle?

    /Hans

    ---
    Below here is reference and links to Oracle info: Since this is cross
    posted to a number of non-Oracle groups, for reference to those who have
    not looked at the material, the relevant documentation links:

    Oracle docco:
    http://docs.oracle.com

    Oracle docco for Oracle9i Release 2:
    http://www.oracle.com/pls/db92/db92.docindex?remark=homepage

    Oracle docco for 9iR2 XMLDB: (warning - link is split)
    http://download-west.oracle.com/docs/cd/B10501_01/
    appdev.920/a96620/xdb01int.htm

    General info portal to Oracle XML capabilities:
    http://www.oracle.com/technology/tech/xml/index.html

    (I've only referenced 9i Release 2 even though Oracle10g is out and has many
    relevant improvements. Oracle has had XML support since 8i in the late
    90's, and many don't like looking at the latest version.)



    I've also dropped defunct newsgroups from the distribution.
    comp.database,
    comp.database.oracle,
    comp.database.oracle.server,
    comp.databases
    in general are not relevant or current newsgroups.


    FInally, for those who don't have access to the docco because they have not
    registered with Oracle's TechNet, a snippet from the Oracle Concepts
    manual:


    XMLType

    This Oracle-supplied type can be used to store and query XML data in the
    database. XMLType has member functions you can use to access, extract, and
    query the XML data using XPath expressions. XPath is another standard
    developed by the W3C committee to traverse XML documents. Oracle XMLType
    functions support many W3C XPath expressions. Oracle also provides a set of
    SQL functions and PL/SQL packages to create XMLType values from existing
    relational or object-relational data.

    XMLType is a system-defined type, so you can use it as an argument of a
    function or as the datatype of a table or view column. You can also create
    tables and views of XMLType. When you create an XMLType column in a table,
    you can choose to store the XML data in a CLOB column or object
    relationally.
    HansF, Oct 28, 2004
    #11
  12. "Alex Shirshov" <> wrote:

    >Hello, DA!
    >You wrote on Wed, 27 Oct 2004 19:10:47 -0700:


    >[Sorry, skipped]
    >
    > DM> The data can be easily stored in relational form and the XML
    > DM> reconstituted by either the database or by the app server. Benchmarks
    > DM> I've seen support the proposition that reconstitution on the app server
    > DM> gives the best overall performance.
    >
    >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

    ^^^^^^^^^^^ ^^^^^^^^^^^^^^
    All data is structured, or it is just noise (and not data).

    "semi-structured" is like "half-pregnant".

    >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.
    >I emphasize that storing semistructured xml documents into DB is the primary
    >use case. And we should discuss the problem not only with relation to
    >performance, but also extensibility, maintainability, complexity, etc.


    You are right. It appears you realise that the XML is difficult
    to work with. You should look at those factors.

    Sincerely,

    Gene Wirchenko

    Computerese Irregular Verb Conjugation:
    I have preferences.
    You have biases.
    He/She has prejudices.
    Gene Wirchenko, Oct 28, 2004
    #12
  13. comcast

    Lemming Guest

    On Thu, 28 Oct 2004 09:35:22 +0400, "Alex Shirshov" <>
    wrote:

    >Hello, DA!
    >You wrote on Wed, 27 Oct 2004 19:10:47 -0700:
    >
    >
    >[Sorry, skipped]
    >
    > DM> The data can be easily stored in relational form and the XML
    > DM> reconstituted by either the database or by the app server. Benchmarks
    > DM> I've seen support the proposition that reconstitution on the app server
    > DM> gives the best overall performance.
    >
    >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.


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

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

    [1] XML can be described as "wonderful" only for very low values of
    wonderful.
    Lemming
    --
    Curiosity *may* have killed Schrodinger's cat.
    Lemming, Oct 28, 2004
    #13
  14. Hello, HansF!
    You wrote on Thu, 28 Oct 2004 06:45:43 GMT:


    [Sorry, skipped]

    H> Just curious whether you have looked at the XMLType and the XML DB
    H> capability intrinsic to Oracle?

    No, I'm mostly working with MS SQL. AFAIK, new xml data type in SQL Server
    9.0 is almost akin to XMLType in Oracle.

    [Sorry, skipped]

    With best regards, Alex Shirshov.
    Alex Shirshov, Oct 28, 2004
    #14
  15. Gene Wirchenko wrote:

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

    >
    > ^^^^^^^^^^^ ^^^^^^^^^^^^^^
    > All data is structured, or it is just noise (and not data).
    >
    > "semi-structured" is like "half-pregnant".


    Well, in fact semi-structured data in XML world is common term
    referring to XML documents having sort of variant and flexible
    substructure (usually traditional text documents, such as books or
    articles) whose content model can be described using complex union
    types, xs:choice's, & connectors, xs:any etc. Unstructured data in XML
    terms is probably DTD/Schema-less documents.

    --
    Oleg Tkachenko [XML MVP]
    http://blog.tkachenko.com
    Oleg Tkachenko [MVP], Oct 28, 2004
    #15
  16. 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.
    Alex Shirshov, Oct 28, 2004
    #16
  17. "Oleg Tkachenko [MVP]" <oleg@NO!SPAM!PLEASEtkachenko.com> wrote:

    >Gene Wirchenko wrote:
    >
    >>>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

    >>
    >> ^^^^^^^^^^^ ^^^^^^^^^^^^^^
    >> All data is structured, or it is just noise (and not data).
    >>
    >> "semi-structured" is like "half-pregnant".

    >
    >Well, in fact semi-structured data in XML world is common term
    >referring to XML documents having sort of variant and flexible
    >substructure (usually traditional text documents, such as books or
    >articles) whose content model can be described using complex union
    >types, xs:choice's, & connectors, xs:any etc. Unstructured data in XML
    >terms is probably DTD/Schema-less documents.


    Oh, I know. I think that it is a lousy term.

    Sincerely,

    Gene Wirchenko
    Computerese Irregular Verb Conjugation:
    I have preferences.
    You have biases.
    He/She has prejudices.
    Gene Wirchenko, Oct 28, 2004
    #17
  18. Lemming <> wrote:

    [snip]

    >Nor is it easy to amend the programs which consume the wonderful[1],
    >semi-relational xml format. My current client has a so-called
    >"partner" who every week or two will send xml files containing new
    >elements and/or attributes without telling my client's development
    >team beforehand, and then can't understand why the files can't be
    >processed.
    >
    >The fact that xml is a chaotic, unstructured, bloated mess and that
    >even apparently experienced xml-oriented developers can't understand
    >that changing their file format has an impact on others is not the
    >fault of the RDBMS.
    >
    >[1] XML can be described as "wonderful" only for very low values of
    >wonderful.


    Like "won", I mean "one".

    Sincerely,

    Gene Wirchenko

    Computerese Irregular Verb Conjugation:
    I have preferences.
    You have biases.
    He/She has prejudices.
    Gene Wirchenko, Oct 28, 2004
    #18
  19. comcast

    DA Morgan Guest

    Alex Shirshov wrote:

    > Hello, DA!
    > You wrote on Wed, 27 Oct 2004 19:10:47 -0700:
    >
    >
    > [Sorry, skipped]
    >
    > DM> The data can be easily stored in relational form and the XML
    > DM> reconstituted by either the database or by the app server. Benchmarks
    > DM> I've seen support the proposition that reconstitution on the app server
    > DM> gives the best overall performance.
    >
    > 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.
    > I emphasize that storing semistructured xml documents into DB is the primary
    > use case. And we should discuss the problem not only with relation to
    > performance, but also extensibility, maintainability, complexity, etc.
    >
    > With best regards, Alex Shirshov.


    I would have to see a specific example of the semistructured XML to
    respond. But you should take a look at Oracle's object-relational
    capabilities if you are not already familiar with them.
    --
    Daniel A. Morgan
    University of Washington

    (replace 'x' with 'u' to respond)
    DA Morgan, Oct 29, 2004
    #19
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brent Ritchie

    XML as a relational database?

    Brent Ritchie, Aug 27, 2003, in forum: XML
    Replies:
    5
    Views:
    502
    Rosimildo da Silva
    Aug 28, 2003
  2. Brent Ritchie

    RE:XML as a relational database?

    Brent Ritchie, Aug 29, 2003, in forum: XML
    Replies:
    2
    Views:
    588
    Scott Raymond
    Aug 30, 2003
  3. Markus Seibold
    Replies:
    5
    Views:
    658
    Andy Dingley
    Nov 13, 2003
  4. Mike
    Replies:
    0
    Views:
    444
  5. sonos
    Replies:
    25
    Views:
    925
    Tor Rustad
    Aug 31, 2007
Loading...

Share This Page