944,103 Members | Top Members by Rank

Ad:
Mar 10th, 2006
0

creating a report from XML using DOM

Expand Post »
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>
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
nisaa15 is offline Offline
14 posts
since Jun 2005
Oct 12th, 2006
0

I Kiss The Only One I Love.

Hi
Reputation Points: 10
Solved Threads: 0
Newbie Poster
pice23 is offline Offline
1 posts
since Oct 2006
Oct 13th, 2006
0

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.
Reputation Points: 118
Solved Threads: 30
Posting Shark
linux is offline Offline
931 posts
since Aug 2006
Oct 14th, 2006
0

Re: creating a report from XML using DOM

I also got PM spam from him (And reported it)
Reputation Points: 1054
Solved Threads: 28
Nearly a Senior Poster
The Dude is offline Offline
3,425 posts
since Dec 2005
Oct 14th, 2006
0

Re: creating a report from XML using DOM

pice23 has now been officially warned about the PM spam stuff...
Administrator
Staff Writer
Reputation Points: 1418
Solved Threads: 37
Freelance Word Punk
happygeek is offline Offline
5,570 posts
since Mar 2006
Oct 14th, 2006
0

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.
Reputation Points: 10
Solved Threads: 2
Junior Poster in Training
cyfm is offline Offline
72 posts
since Oct 2006
Oct 16th, 2006
0

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)
Last edited by The Dude; Oct 16th, 2006 at 9:26 am.
Reputation Points: 1054
Solved Threads: 28
Nearly a Senior Poster
The Dude is offline Offline
3,425 posts
since Dec 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in XML, XSLT and XPATH Forum Timeline: Google Base Data API good news for Blogger bloggers
Next Thread in XML, XSLT and XPATH Forum Timeline: XML Book





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC