Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


parsing childs

From: frunny@-----.---
To: NULL
Date: 6/3/2006 5:42:00 AM

Hi all,

I dont know why but XML dont likes me, again I am sitting here and try
to get some data from a very easy xml file. I really dont get it. I
have invested more than 2 weeks looking at different sites, books ( I
have 2 of them ) and so on - but it seams xml is not my friend. Can
someone tell me why it is that complicated? I code since 25 years and
dont get it to run. Perhaps I do a big error in all my thinkings.

Anyway, perhaps someone can help me - that would be very nice
Please see the XML file below

<response stat="ok">
 <photos page="1">
  <photo id="152641843" />
  <photo id="152641841" />
 </photos>
</response>

I need to loop through all the childs from the node "photos"
I tried with nextSibling, and many other things - but I always get
"Object doesn't support this property or method" or other errors.

this is my code
Dim photos
Set photos =  xmlDom.selectNodes ("//photos")
for each photo in photos
for xi=0 to 2
response.write(photo.SelectSingleNode("photo/@id").Value & "<br />")
photo.nextSibling
next
next

this code works, but only gives me back 1 photo id?
I think it is because I loop through the nodes - and there is only 1
node
but how i can loop through all the childs of the given node?
I think this must be easy - but it seams not to

thanks for any tipp or hint
Andy



transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent