|
Post by RavynousHunter on Jun 15, 2011 14:55:58 GMT -5
Okay, I know...I'm a bit hapless in certain areas, but I can't for the life of me figure this out at all.
Basically, I'm trying to design a system that takes an XML file, and turns the nodes into two things:
1) A TreeView which represents the whole hierarchy. 2) A Dictionary<string, string> that will tell the program which file to load for a particular entry when a node in the TreeView is selected.
Alright, I know how to get most things set up. I have the HTML files stored in an archive (so they take up less space), and I can extract them and view them with a WebBrowser control. Its just reading the XML nodes and turning them into a TreeView and Dictionary that is confounding me.
Here's my basic idea:
<node file="filename.htm">Name</node>
Now, the node can have child nodes, as well, so each topic has its sub-topics and so on.
If someone could either give me a piece of code or point me in the right direction, I'd be much obliged.
|
|
|
Post by Distind on Jun 15, 2011 20:11:41 GMT -5
System.xml is probably a good place to start, from there you have the component elements to create the directory and treeview out of, but I've never used the thing.
From what I see it can load an XML file and give you a node listing, with attributes for nodes.
|
|
|
Post by Yla on Jun 16, 2011 12:43:00 GMT -5
I had a great experience with this XML Parser. It's written in very simple C++ (actually more like C with classes), and you're using C#, so I don't know if you can use it, but I'll recommend it anyway.
|
|
|
Post by RavynousHunter on Jun 17, 2011 14:30:13 GMT -5
Well, the C++ parser code may be useful...I know how to import unmanaged DLLs and, if all else fails, I may be able to translate the code over.
Also, I'll look back into System.XML...maybe there was something I was missing, or my queries were too specific.
|
|
|
Post by Old Viking on Jun 17, 2011 15:34:00 GMT -5
I hope you're aware that you don't have to do this if you don't want to.
|
|
|
Post by RavynousHunter on Jun 17, 2011 15:39:10 GMT -5
But I do want to! Programming is frustrating as all fuck, got god damn is it rewarding when I get something to work!
|
|