Hi all,

I am transitioning a bunch of data from html (yuck!) to some sort of separated schema. I was going to use xml:

<events>
 <event>
  <title>
  <date>
  <speaker>
  <description>
 </event>
</events>

but now I am wondering if I should use a real database instead. Can anyone comment on when it is appropriate to use XML and the difference in the case when you would want to use SQL?

Thanks,

David

>I am transitioning a bunch of data from html (yuck!) to some sort of separated schema.

Do not use XML as Database (XML is mainly for Interoperability). Use SQL Database.

EDIT:

Thread - http://www.daniweb.com/forums/thread129793.html

How would I go about entering the data into an sqlite database (I want to just have a file, not run a server process). With XML I would just edit a text file, with mdb I would use Access, but surely there is a better way than the command line (which is what I see in all of the tutorials) for sqlite?

Also, what do you mean by "Interoperability" purposes only?

Thanks,
David

An XML (or object) database would be appropriate for highly hierarchical data which cannot be properly organized in tables. This might be the case if the objects have disparate and different attributes (fields) with little or no common subsets.
Your data sample seems to be a quite ordinary sample for tabular data which are best expressed and stored in a standard SQL database.
I don't know about SQLite, but for MySQL there is a bunch of editing tools out there in the wild (Navicat, HeidiSQL, phpMyAdmin, to name a few). The command line client mysql is still the best for efficient work and for scripts which convert from one format (XML) to the other (SQL).

>what do you mean by "Interoperability"

Definition from wiki. Interoperability is a property of a product or system, whose interfaces are completely understood, to work with other products or systems, present or future, without any restricted access or implementation. XML has a data format and data model but data model is not its main usage. In fact XML provides a means to communicate data across networks and among heterogeneous applications. It is a common information technology, supported in different development tools and applications.

First you could create an SQLite database with one table into which you will insert all the data. (Later you may want to normalise the data by creating other tables and copying data into them from your first table.)

Then you could use a programming language such as perl or python to extract the data from the html and transform it into a series of INSERT statements which you can run in SQLite.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.