Re: Parsing XML to a TreeView
- From: MuZZy <tnr@xxxxxxxxxxxxxxxxx>
- Date: Tue, 03 Jan 2006 23:39:41 -0500
MuZZy wrote:
Hi,
Consider i have an XML file like this: <node type="item"> <user>MuZZy</user> <password>Password</password> <node> <node type="folder"> <node type="item"> <user>John</user> <url>www.website.com</url> </node> <node type = "folder"> <node type = "item"> <memo>free text</memo> </node> </node> </node>
Here each <node> will be a TreeNode and the other tags like <user>, <url>, <password> are some properties stored in the tree node. Nodes can be of two types: "folder" and "item". "folder" can contain "item"'s
There can be unlimited nesting of <node> except that <node type="item"> can't contain any nodes, but <node type = "folder"> can.
So how do i parse it into a treeview? I am using a XmlTextReader nut it reads the whole XML in line, so i can't really determine parent/chaild relations between nodes.
I'm sure there is a standard way of doing that but i can't find one... Any ideas?
Thank you, MuZZy
Actually. i got it! I just need to use XMLDocument instead .
- Follow-Ups:
- Re: Parsing XML to a TreeView
- From: "Yuan Ren[MSFT]"
- Re: Parsing XML to a TreeView
- From: "Yuan Ren[MSFT]"
- Re: Parsing XML to a TreeView
- References:
- Parsing XML to a TreeView
- From: MuZZy
- Parsing XML to a TreeView
- Prev by Date: LookupPrivilegeValue function always return true irrespective of privilege status
- Next by Date: Re: debugging problems
- Previous by thread: Parsing XML to a TreeView
- Next by thread: Re: Parsing XML to a TreeView
- Index(es):