[thelist] xml vs. regular database

Chris W. Parker cparker at swatgear.com
Thu Jan 16 16:12:01 CST 2003


hi.

i was just reading about xml and found out that i could do something
pretty interesting. it goes a little something like this...

----------
<xml id="cdcat" src="cd_catalog.xml"></xml>

<table border="1" datasrc="#cdcat">

<tr>
<td><span datafld="ARTIST"></span></td>
<td><span datafld="TITLE"></span></td>
</tr>

</table>
----------

as some of you know i'm sure, this basically prints out all the data in
the xml file. (that is all the elements in the xml file that match the
datafld's in the table.) this seems really cool and it seems easier than
making a db call, but i don't see exactly why it's better than making a
db call. even if you used an xml file you would still need to get the
data there. so you'd still have to make a db call and write and retrieve
data. alternatively you could write directly to the xml file, but that
seems more cumbersome.

now for my questions.

1. what's the difference between xml and a flat text database?

2. why use xml over a standard call to a db?

3. is xml only useful if no database can be used and/or data is to be
transferred between two dissimilar systems? that is, i can't send an
MSSQL database to a system running 9i.

as far as i'm concerned, i think...

<person>
 <name>spiderman</name>
 <coolness>5000</coolness>
</person>
<person>
 <name>mickey mouse</name>
 <coolness>-23</coolness>
</person>

...makes more sense than...

spiderman|5000
mickey mouse|-23

but still, i don't see an advantage to learning something new like
xml/xsl/<more xml related acronyms> over sticking with db's and the
like.



this is probably a common question so forgive me if you've explained
this all before.

thanks,
chris.



More information about the thelist mailing list