Results 1 to 5 of 5

Thread: listbox and xml

  1. #1

    Thread Starter
    Registered User
    Join Date
    Jul 2001
    Posts
    283

    listbox and xml

    say i have an xml file like this
    <folders>
    <path="C:\test" subfolders="false"/>
    <path="C:\New Folder" subfolders="true"/>
    </folders>

    how do i auto fill a listbox with an item for every folder, where the name of the item is the path and the tag is the boolean value of the subfolders variable?

    any ideas or some code??

    thanks already...

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    There is no automatic way to do it but you just have to parse the xml file. Just use the SelectNodes method and "//path" to get all path nodes then loop through and add away.

  3. #3

    Thread Starter
    Registered User
    Join Date
    Jul 2001
    Posts
    283
    Originally posted by Edneeis
    Just use the SelectNodes method and "//path"
    can you explain the syntax of those two functions??

  4. #4
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Actually its one function SelectNodes which accepts an xpath string as an argument and returns a NodeList of the results. The "//path" is the xpath string to use if the xml you posted is the entire structure of the file.

  5. #5

    Thread Starter
    Registered User
    Join Date
    Jul 2001
    Posts
    283
    thanks edneeis for the fast replies..

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