|
-
Jan 1st, 2004, 01:35 PM
#1
Thread Starter
Registered User
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...
-
Jan 1st, 2004, 01:40 PM
#2
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.
-
Jan 1st, 2004, 01:48 PM
#3
Thread Starter
Registered User
Originally posted by Edneeis
Just use the SelectNodes method and "//path"
can you explain the syntax of those two functions??
-
Jan 1st, 2004, 01:52 PM
#4
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.
-
Jan 1st, 2004, 02:08 PM
#5
Thread Starter
Registered User
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|