> > And if you think about it, it's pretty obvious why. XML's
> 'revolution'
> > is to come up with a consistent way of representing data
> and meta data.
> Er. No. This has been possible in regular SGML since the beginning.
> XML just took away the nubbly bits and made the syntax stricter.

Perhaps I should have said - revolution for the web. SGML has been round
a long time, sure, but no-one ever told me about it! All the existing
systems I have seen or read about seem to relate to large-scale document
storage and retrieval - at great expense. A pretty exclusive club,
really. XML allows for the idea that the web is one great big database,
and that data can be moved around, processed or formatted very easily. I
know it's obvious, but the separation of data and format on the web is
'a revolution' of sorts.

Also, I emphasise my use of the word 'consistent', since adoption is
half the battle.

> > Now this IS interesting. From a database point of view, XML
> is amazing.
> This is very interesting. Can you identify what it is that XML doing
> that makes it amazing, and what SGML didn't have?

Nothing, except the fact that everyone wants a piece of it. Revolutions
happen because of the application of a technology even more so than in
its invention, although they obviously could not happen without the

> > It is far more significant than mere text mark-up. IMHO it is worth
> > broadening your notion of what a 'document' is, after all, there is
> > nothing in the XML spec. that says a document is a play by
> Shakespeare,
> > or an insurance claim. In fact it could be a list of historical GDP
> > figures for a country.
> No-one has ever suggested it couldn't be, but I'd suggest that using
> XML markup to identify that kind of data is inefficient.

Depends what you mean by inefficient. Of course it's inefficient in
terms of storage and inefficient in terms of bandwidth. But is it not
immensely efficient to be able to edit, store and transmit my GDP
figures with much the same software and techniques that are used for
Hamlet? Is it not very efficient that you could devise a web page that
contains my GDP figures next to a soliloquy in whatever colours you
choose? (... should you wish :-)) We are about to enter an exciting era
of what Microsoft always bang on about on their web site - leverage. I
know it's their buzz word, but it is true that you get increasingly
rapid rates of development the more that people build on each other,
rather than going their separate ways. If someone devised an efficient
XML storage and retrieval system - good indexing, fast searches,
efficient compression - then every single application we are developing
would benefit. It's like when hardware improves, your application
improves, but you haven't done any work to it.

> > >    The attribute table has a join on the element table to say what
> > >    element the attribute belongs to, whilst the element has joins
> > >    to itself to say who the parent of an element is. This allows
> > >    us to store an object-like tree structure, and so generate XML
> > >    documents from any point in the tree.
> Not being a database person, I'm still hazy on what this means, but I
> think it means that if you list all the attributes and all the
> elements, you can draw a line joining an attribute to the element it
> belongs to, and between elements to show hierarchy. This is highly
> dangerous approach, because it changes the nature of the
> attributes. In an SGML system, an attribute belongs ONLY to the
> element or elements against which it was declared. That is to say, you
> can have
>    <!ELEMENT food (#PCDATA)>
>    <!ATTLIST food group CDATA #REQUIRED>
> where "group" could be "fat", "sugar", "beer", "chocolate", or any of
> the other standard foodgroups, but
>    <!ELEMENT font (#PCDATA)>
>    <!ATTLIST font group (sans|serif|script) #IMPLIED>
> which can have a completely different meaning. If I understand the
> "table" approach, it flattens the collection of attributes which occur
> in a DTD into a single list, in which "group" occurs only once, with
> joins to "food" and "font" element types. This would be an error, as
> far as I can see. But maybe I've missed something.

We've done more dangerous things! Actually, in my initial email I was
only trying to give a broad brush-stroke approach to the problem, so if
I have to be more precise, here goes. We actually use five tables:

- A table that defines the attributes, e.g. is the attribute an integer
or string, is there a list of possible values, etc. At this level we've
also done some things that I don't think can be expressed in a DTD (but
wouldn't swear to it), but have been hinted at in other areas
(XLink/XPointer/XSchema), like defining an attribute that points to
another node in the tree. We have also implemented some attribute types
that make for greater efficiency, such as an attribute type that when
rendered as XML will contain the database value of a named element in
its parent object. (This is important if a node is passed out that needs
to contain information from its parent, but to pass the whole parent as
well would be wasteful.)

- A table that defines elements. This table lists all the attributes
that an element can have. It is here that we differentiate between the
two 'group' element types that you define above - they are different
attributes in different elements.

- A table that says what objects can contain what other objects.

Taken together these three tables would correspond to the DTD. We then
have, for the data:

- A table that 'instantiates' the attributes. Each row contains the data
itself, an index into the 'type of attribute' table, and an index into
the 'type of the element' table.

- A table that 'instantiates' the elements. Each row contains an index
into the 'type of element' table, and an index into the actual element
table (this one), to indicate the parent of the element.

So, using joins left, right and centre we can pull out any node, its
attributes and its children. Hopefully you can also see that each
attribute is completely independent. The nice thing is that you could
still use the same attribute in many different elements, or you could
have different attributes with the same name in different elements.

> > To re-iterate, I suggested a way of storing objects in a relational
> > database that only uses about three or four tables, yet can store
> > elements, attributes, and - very importantly - their hierarchical
> I'd want to look very hard at the way it identifies attributes.

Please do.

[revolution - again]
> > relationship. Once established, that 'object database' can
> be used to
> > store data that can be exported as XML. And it is very, very easy to
> > export XML that contains mixed content. (As well as DTDs, XSL and
> > whatever else we feel like.)
> I think you;re right, but I don't see what's so special or
> new about it.

As above.

> > But secondly - although I hate being pedantic, you guys
> bring it out of
> > me - what it human-legible? No-one has defined it, but
> everyone loves to
> ASCII or a character set that can be read in an editor without
> conversion or interpretation. Even with difficulty (like having to
> make your eye skip over pointy bracket bits).

So your editor is not converting from .....

> > throw it around. Is a bitmap human legible?
> No, its binary.

..... binary then? Bitmaps are binary (or octal or hexadecimal or
electrons) as are XML files. No matter how you twist and turn they are
all being interpreted by software and presented using metaphors that we
are more or less familiar with. For example, with a little practice you
could just about read text displayed in hexadecimal, just as you could
read the letters of the alphabet (the price I pay for being an
ex-assembler programmer :-))

> > bytes. Yet has the bitmap changed between the two
> situations? Further,
> > is an XML file stored on your hard disk but with no copy of
> notepad on
> > the computer human legible?
> Yes. You can type MORE MYFILE.XML in a DOS window and read it.

Very good. And what if that was removed? What makes it human-legible is
not the software.

> > meaningful way without needing anything more advanced than
> a simple text
> > editor. This is not really for humans sake - are you really going to
> > curl up in bed with Midsummer Nights Dream all tagged up?
> It is more to
> No, but I often have to get into people's files with a
> plaintext editor
> to fix up the things that more foolish software has corrupted.

That is not the point though.

> > More than this, with the 'separate document' solution how
> do you create
> > a table of contents? You can create a separate document, but what if
> > someone discovers a new work by Shakespeare? You'd have to
> add the new
> > play and then edit your table of contents document. Our
> solution would
> > do it automatically, since the table of contents is a 'virtual' XML
> > document, created as a query on the XML objects. This
> automation is what
> > databases are good at.
> Everything you say is perfectly correct, but you're treating it as if
> it was discovered yesterday. The only problem with existing systems is
> they tend to be expensive...

Very. As it happens, I don't think it was discovered yesterday. I DO
think that the people who have devised these systems have probably
missed out on a major opportunity. Many people are coming at this from
the document direction, but I have come to this from a database
direction, and I apologise for being so excited. But my guess is that
the DB and systems people will make the running on this in the next few
years (the big guys ... not the small guys like me!)

Interesting points though Peter. Very interesting.



Mark Birbeck
Managing Director
Intra Extra Digital Ltd.
39 Whitfield Street
t: 0171 681 4135
e: [log in to unmask]