Re: XML data reading



Steve,

you may use the SMImport suite:
http://www.scalabium.com/smi

Just check the sample project in DEMOS\CreateTable\XMLLoad directory. All
what you need is to change the xml-tags to convert your xml to dataset:
SMImportFromXML.XMLTags.RowTag := 'CATEGORY';
SMImportFromXML.XMLTags.RecordTag := 'CATEGORY';

--
With best regards, Mike Shkolnik
Scalabium Software
http://www.scalabium.com
mshkolnik@xxxxxxxxxxxxx
"SteveW" <Stevewarby@xxxxxxxxxxxxxx> wrote in message
news:45e46ae1$1@xxxxxxxxxxxxxxxxxxxxxxxxx
We have just playing around with a new web based shopping cart and the
data
is stored in xml. Is there a way to display the data the same way as a
dataset.

ie with master details links.

There are the following files:

categories.xml
<?xml version="1.0" encoding="UTF-8" ?>
- <category>
<category category_id="undefined" category_name="Steriex"
category_description="desc for 4"
category_pagestyle="default_category_style" category_image="Image_002.JPG"
category_order="4" />
<category category_id="3" category_name="Cartoons"
category_description="Cartoon" category_pagestyle="default_category_style"
category_image="Image_002.JPG" category_order="3" />
<category category_id="undefined" category_name="undefined"
category_description="undefined" category_pagestyle="undefined"
category_image="undefined" category_order="undefined" />
<category category_id="2" category_name="King 1"
category_description="Description Unavailable."
category_pagestyle="default_category_style" category_image="Image_001.JPG"
category_order="2" />
<category category_id="1" category_name="Prk 1"
category_description="Category 1 description..."
category_pagestyle="default_category_style" category_image="Image_002.JPG"
category_order="1" />
</category>

subcategories.xml

<?xml version="1.0" encoding="UTF-8" ?>
- <subcategory>
<subcategory subcategory_id="3" subcategory_name="Park sub 2"
subcategory_category_id="1" subcategory_desc_cat="Park sub 2"
subcategory_desc_subcat="undefined" subcategory_pagestyle="undefined"
subcategory_image_cat="Image_002.JPG" subcategory_image_subcat="undefined"
subcategory_order="3" />
<subcategory subcategory_id="2" subcategory_name="King Subcategory Name"
subcategory_category_id="2" subcategory_desc_cat="Short Description
Unavailable." subcategory_desc_subcat="Long Description Unavailable."
subcategory_pagestyle="default_subcategory_style"
subcategory_image_cat="noimage.jpg" subcategory_image_subcat="noimage.jpg"
subcategory_order="2" />
<subcategory subcategory_id="1" subcategory_name="Park Subcategory 1"
subcategory_category_id="1" subcategory_desc_cat="Subcategory 1 short
description..." subcategory_desc_subcat="Subcategory 1 long
description..."
subcategory_pagestyle="subcategory_default"
subcategory_image_cat="Image_002.JPG"
subcategory_image_subcat="noimage.jpg"
subcategory_order="1" />
</subcategory>

store.xml
<?xml version="1.0" encoding="UTF-8" ?>
- <inventory>
<inventory sku="Cartoon1" status="available" name="First cartoon"
price="222" shipping1="0" shipping2="0" handling="0" description="First
cartoon" discount="0" image_small="none" image_small_scale="scale"
image_medium="none" image_medium_scale="scale" image_large="none"
image_large_scale="scale" options1="option1|option
label,1.00,none,1|option
label,2.00,none,2|option label,3.00,none,3" options2="" options3=""
weight="0" category_id="3" subcategory_id="0" media="undefined"
file="undefined" />
<inventory sku="Park1" status="available" name="Park 2" price="9.99"
shipping1="0" shipping2="0" handling="0" description="Description
unavailable." discount="1" image_small="none" image_small_scale="scale"
image_medium="none" image_medium_scale="scale" image_large="none"
image_large_scale="scale" options1="" options2="" options3="" weight="0"
category_id="1" subcategory_id="1" media="undefined" file="undefined" />
<inventory sku="demo-1" status="available" name="Parkforce solution"
price="34.95" shipping1="0" shipping2="0" handling="0"
description="Description unavailable." discount="5.00"
image_small="Image_002.JPG" image_small_scale="scale"
image_medium="Image_002.JPG" image_medium_scale="scale" image_large="none"
image_large_scale="scale" options1="" options2="" options3="" weight="0"
category_id="1" subcategory_id="1" media="" file="" />
</inventory>


I am presuming this is some form of chinese dialect....

Joking apart... The shopping cart has a cumbersome web interface to update
data so I need to write a 'Delphi' app to allow editing the data.

Cheers

SteveW




.