[thelist] XML data import advice

Mark Rees mrees at itsagoodprice.com
Mon Oct 10 10:08:38 CDT 2005


Hello

I have an interesting problem to solve. I have an XML file of product
descriptions, which I need to marry up to several other text or xml files or
price lists, and insert the whole lot into MSSQL tables. DTS will be used to
accomplish this. The thing is that I need to classify the products into
categories at the same time.

I can identify how the products will be divided up into categories based on
the XML data. However I need to be able to edit these definitions.

An example is probably in order

The descriptions look something like this
<product id="1" name="ninja" manufacturer="kawasaki">
<attribute name="cc" value="600"/>
<attribute name="wheels" value="2"/>
</product>
<product id="2" name="cobra" manufacturer="AC">
<attribute name="cc" value="3000"/>
<attribute name="wheels" value="4"/>
</product>

The categorisation would look something like this

<category name="cars">
<attribute name="wheels" value="4"/>
    <subcategory name="gasguzzlers">
        <attribute name="cc" value="3000"/>
    </subcategory>
</category>

So you can see that  product  2 fits into cars/gasguzzlers

The idea of maintaining the categorisation in XML appeals because it is
readable both by humans and machines, and editing it is a simple process.

The end product will be a database table looking something like this

t_products
productid
productname
price
category

I would like to generate the category based on the XML file detailed above.
I am not clear on the best way to do this. The tools I have at my disposal
are SQL Server, vbscript and PHP.

Any advice will be appreciated, as well as criticisms of this approach to
the problem, and suggestions of other ways to go about it.

Thanks in advance

Mark
www.itsagoodprice.com - top-brand electronics for less.




More information about the thelist mailing list