OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   Re: [xml-dev] Tree v. Table - A relational XML object model...?

[ Lists Home | Date Index | Thread Index ]

At 6:31 AM -0500 2/27/03, John Cowan wrote:

>Most of those things aren't represented in SAX anyway.  But what this model
>(which I otherwise like very much) absolutely boots on is mixed content:
>it simply can't represent it at all, and an incoming document with mixed
>content has to be rejected altogether.

Does it really? It seems to fit pretty nicely to me. For example,

    <doc>This is <strong>very</strong> important.</doc>

Is stored as

    1, 1, ELEMENT, "", doc, null
    2, 2, PCDATA, "", null, "This is"
    3, 2, ELEMENT, "", strong, null
    4, 3, PCDATA, "", null, "very"
    5, 2, ELEMENT, "", strong, null
    6, 2, PCDATA, null, null, " important.

Whether this is useful or not I don't know, and it's not obvious how 
attributes fit in. Probably another table.

You could use XPath values instead of DOM values. I think those are 
more useful. And you could store either the element name or the 
PCDATA content in a single field depending on node type. (Does that 
violate normalization? I don't know, but probably. )

| Elliotte Rusty Harold | elharo@metalab.unc.edu | Writer/Programmer |
|           Processing XML with Java (Addison-Wesley, 2002)          |
|              http://www.cafeconleche.org/books/xmljava             |
| http://www.amazon.com/exec/obidos/ISBN%3D0201771861/cafeaulaitA  |
|  Read Cafe au Lait for Java News:  http://www.cafeaulait.org/      |
|  Read Cafe con Leche for XML News: http://www.cafeconleche.org/    |


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS