DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   XML, XSLT and XPATH (http://www.daniweb.com/forums/forum134.html)
-   -   creating a report from XML using DOM (http://www.daniweb.com/forums/thread40854.html)

nisaa15 Mar 10th, 2006 6:49 am
creating a report from XML using DOM
 
HI,
Im relatively new to XML and was wondering how I could use DOM to produce a "per shop" report showing a list of the items available in the given shop (shop 1 first then 2), the item description, stock level and calculate a total value of the stock level from the xml code below? I want to use the shop id as an input to the program. How can I get to the shop element and from there choose the item child?


<shops>
<shop number="1">
<address>
<street>Rigby Lane</street>
<town>Houghton</town>
</address>

<items>

<item number="11">
<itemname>Black Coat</itemname>
<description>long coat</description>
<price>15.99</price>
<stocklevel>12</stocklevel>
</item>

<item number="12">
<itemname>Jumper</itemname>
<description>DKNY wool</description>
<price>40.99</price>
<stocklevel>7</stocklevel>
</item>

<item number="13">
<itemname>Gloves</itemname>
<description>blue gloves</description>
<price>0.99</price>
<stocklevel>23</stocklevel>
</item>
</items>
</shop>

<shop number="2">

<address>
<street>Polaris Road</street>
<town>High Wikem</town>
</address>

<items>
<item number="14">
<itemname>Boots</itemname>
<description>Ankle</description>
<price>35.00</price>
<stocklevel>2</stocklevel>
</item>

<item number="15">
<itemname>Tights</itemname>
<description>denier 60</description>
<price>5.49</price>
<stocklevel>19</stocklevel>
</item>

</items>
</shop>
</shops>

pice23 Oct 12th, 2006 7:20 pm
I Kiss The Only One I Love.
 
Hi

linux Oct 13th, 2006 7:24 pm
Re: creating a report from XML using DOM
 
I don't know if this is an old post or not. pice23 has been spamming my PM box, and this above post is also spam. do something, someone.

The Dude Oct 14th, 2006 12:13 am
Re: creating a report from XML using DOM
 
I also got PM spam from him (And reported it)

happygeek Oct 14th, 2006 7:40 am
Re: creating a report from XML using DOM
 
pice23 has now been officially warned about the PM spam stuff...

cyfm Oct 14th, 2006 8:36 pm
Re: creating a report from XML using DOM
 
excus me but can you please ban that guy or something as he keeps spamming my pm over and over and I'm getting pissed off.

The Dude Oct 16th, 2006 9:26 am
Re: creating a report from XML using DOM
 
Quote:

Originally Posted by happygeek
pice23 has now been officially warned about the PM spam stuff...

Thats very nice ... Most sites if someone Spams someone via PM they are banned straight away... (I hope he doesnt do it anymore)


All times are GMT -4. The time now is 4:49 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC