PDA

View Full Version : Complex populating Tree by XML



PFD
01-12-2008, 10:23 AM
Hello, I need help with populating a tree by XML.
I've studied some examples but I'm seriously lost here.....

This is what I want to do:

<root>(1)
...<chapter>Title(1.1)
......<part>Title/Text(1.1.1)
.........<data>DataPath(1.1.1.1)</data>
.........<data>DataPath(1.1.1.2)</data></part>
......<part>Title/Text(1.1.2)
.........<data>DataPath(1.1.2.1)</data>
.........<data>DataPath(1.1.2.2)</data></part>
</chapter>
...<chapter>Title(2.1)
......<part>Title/Text(2.1.1)
.........<data>DataPath(2.1.1.1)</data>
.........<data>DataPath(2.1.1.2)</data></part>
......<part>Title/Text(2.1.2)
.........<data>DataPath(2.1.2.1)</data>
.........<data>DataPath(2.1.2.2)</data></part>
</chapter>
</root>

The problem with this is that by populating the tree using the XML.GetElementNames function I see the elementnames which I don't want to see. I want to see the value's in the XML. OK, so I used the XML.GetValue function, but this is a string so a for loop doesn't work here. It's also impossible to use the elementnames as a title because XML won't allow you to use spaces in the element.
And last but not least, is it possible to use visible text in the data element and when the user clicks on it, it uses an invisible path to open a file? (tree.data)

Thanks in advance,
PFD