login about faq

I need to process some data I am getting in an XML file. It is going fine processing 1st level childs but I am getting lost how to get a step lower. The xml file has got a list of properties (real estate) each property has got an undefined number of pictures and features. You can see a sample file here http://www.corobori.com/sos/test.xml

Find below my code retrieving part of the xml file, see "how to do from here ?", this is where I hit a snag

        Dim prop As Chilkat.Xml
        Dim fotos As Chilkat.Xml

        If Not IsNothing(xml0) Then

            Dim n As Long
            Dim iFoto As Long
            Dim i As Long

            child = xml0.FindChild("corredor")
            If (child Is Nothing) Then
            Else
                Response.Write("Content = " & child.Content)
            End If
            child = xml0.FindChild("clave")
            If (child Is Nothing) Then

            Else
                Response.Write("Content = " & child.Content)
            End If

            n = xml0.NumChildrenHavingTag("propiedad")
            For i = 0 To n - 1

                prop = xml0.GetNthChildWithTag("propiedad", i)

                ' Codigo Interno fine 
                Response.Write(prop.GetChildContent("id") & "<br>")

                iFoto = prop.NumChildrenHavingTag("fotos")
                Response.Write("Fotos: " & iFoto & "<br>")

                ' how to do from here ? 
                ' fotos = prop.GetNthChildWithTag("fotos", 1)

            Next

        End If

asked Sep 10 '15 at 10:42

Corobori's gravatar image

Corobori
134


Change this:

                ' how to do from here ? 
                ' fotos = prop.GetNthChildWithTag("fotos", 1)
To this:
                ' how to do from here ? 
                fotos = prop.GetNthChildWithTag("fotos", 0)
The 1st child is at index 0. All of Chilkat always uses 0-based counting. Whenever there is an "index" in a method call, it is 0-based meaning that the 1st item is at index 0.

link

answered Sep 11 '15 at 08:57

chilkat's gravatar image

chilkat ♦♦
11.8k316358421

Thanks a lot, this solved my issue !

link

answered Sep 14 '15 at 10:16

Corobori's gravatar image

Corobori
134

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×59
×43

Asked: Sep 10 '15 at 10:42

Seen: 1,213 times

Last updated: Sep 14 '15 at 10:16

powered by OSQA