From: Mark Hubbart Date: 2004-02-25T07:57:15+09:00 Subject: Re: HTML/XML Parsing... "Ruby Tuesday" wrote in message news:c1gidb$1j6abi$1@ID-205437.news.uni-berlin.de... > I'm wondering if anyone ever come across an example on how to parse an > html > table(with images) using either XSLT or Ruby scripts. > > I'd like to be able to extract all the data and put them in the > database(MySQL, SQLite, etc). > > There's a twist though, some of the image cells has 2 or more jpeg > images > instead of one. Since I'm not an expert database designer, how do you > do > that? > > Table fields: > ------------ > xnum text(40) unique > image jpeg image (may have none, or 1+ images) > desc memo(256) > loc memo(256) > > Thanks. It's been a while since I worked with databases, but perhaps something like this: table 1: "cells" - id int autoincrement primary_key - xnum text(40) unique - desc ... - loc ... table 2: "images" - id int autoincrement primary_key - cell_id int index - image blob that way, more than one image could be linked to the same cell_id. then: SELECT image, xnum FROM images, cells WHERE cell_id = cells.id; ...to select a list of records conating to fields: image data, and cell numbers (assuming that's what the xnum is) Alternatively, you could forgo the ids, and link images via xnums. But I understand that using ids is the "right" way, whatever that means. :)