Results 1 to 2 of 2

Thread: xml data

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2002
    Location
    London
    Posts
    678

    xml data

    How is it possible to get to a specific item in xml?
    For example here is my xml data and I would like to get the value of the <id></id> of the last element. In this case it is 7:
    Thanks

    <user>
    <id>6</id>
    <firstname>jay</firstname>
    <surname>wigmore</surname>
    <age>28</age>
    <phone>876543</phone>
    <email>[email protected]</email>
    </user>
    <user>
    <id>7</id>
    <firstname>john</firstname>
    <surname>jackson</surname>
    <age>32</age>
    <phone>1234 567</phone>
    <email>[email protected]</email>
    </user>

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    To be proper formed XML all these elements would have to be in one root table, but I assume you just didn't post that part. You can either load them into a dataset thru the ReadXML method or use the XMLDocument and the SelectSingleNode method. The help on either of these methods should provide examples enough to get you going.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width