Re: XML vs. databases

From: Richard Wheeldon <richard_at_rswheeldon.com>
Date: Sat, 21 Jul 2001 23:34:17 GMT
Message-ID: <3B46D4CA.237C_at_rswheeldon.com>


Mark Preston wrote:
> >The biggest problem is typing. Databases support concepts
> >such as dates, times, numbers, etc. xml doesn't.
> You are not really aware of all that XML can do.

It would appear not. Please enlighten me. Say I have some xml:

<mytag thisnumber='45' thisdate='4/7/2001'>

How do you impose the typing on these attributes, within xml? and check the documents accuracy w.r.t this typing?

> >Xml also doesn't support any constraint checking internally.
> As mentioned above - it does if you use either Schema or DTD.

Cool. I've obviously been missing something. So (using the example above), I can restrict thisnumber to the range 40-50? or ensure that the value stored in one attribute is equivalent to the value stored in another? or that my one attribute value is present in a list of other tag's attributes of such-and-such a name?

> >Thus you can have a valid xml wrt a dtd and still not know
> >whether the data makes sense,
> Here is the fundamental flaw in your argument - an XML document is a
> document and makes sense as long as it is well-formed. If you use a
> DTD and the XML is valid according to the DTD then it makes sense
> (since the DTD is what defines the "sense" it has to make). If you use
> Schema then you can be much more strict in defining that "sense".

Guess I'll have to take a much better look at Xml Schema,

Richard Received on Sun Jul 22 2001 - 01:34:17 CEST

Original text of this message