Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Odud (1047)

Odud
  (email not shown publicly)

Journal of Odud (1047)

Monday February 11, 2002
06:04 AM

Onwards

[ #2765 ]
Winter illnesses (me, the wife, the kids), real work, other commitments (I do the layout for the parish magazine once a month) and house redecoration has prevented any development on my book cataloguing/indexing project for the last few weeks. However I made some progress over this weekend.

Having decided that the XML describing a book was very simple:

<book>
      <title type='01'>Some title</title>
      <contributor type='01'>An Author</title> ...
</book>

It seems obvious that title, contributor, etc would be tables in the database each having a column linking back to a row in the book table. The book table has a single column holding a unique book id - its purpose is to link the other tables together.

So I've got a big file of input XML - parse it with SAX because I don't need to know anything complicated and won't suffer from "two stops before I do.." problems - write the rows to the database with DBI.

All worked fine - once I remembered to turn off AutoCommit and I've now got a populated database.

Next steps - write some stuff to query it and get the results back as XML - use Sablotron (or similar) to apply XSLT and churn out HTML, TeX, plain text as required.

It's been really good to fasten SAX and DBI to some simple code of my own and produce something useful - and hopefully the query/output stages will be equally rewarding.

But first I have to get the magazine finished.......
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.