471,337 Members | 1,444 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,337 software developers and data experts.

How to build a tree and bind data for a list just by one file XML???

Hi!
I'm working with a GUI ( python coded ). In it, i need to build a treeview and a list that only use 1 file XML. So how i can do it?
ex: i have a file XML like that:
<node1>
<id>01</id>
<name>Hello</name>
.....
</node1>
<node2>
<id>02</id>
<name>Hello</name>
.....
</node2>
...........
In that, i use <node1>,<node2>,..for the tree view, and <id>,<name>,..for the list.
So are there any idea to solve it?

Thanks,
Sep 28 '07 #1
4 1316
bartonc
6,596 Expert 4TB
I infer from this that you mean Tkinter is your GUI framework. Is that correct?

If so, you'll probably find that Tkinter lacks many widgets and a TreeView is one of the missing widgets.

IMO, the best GUI framework for your needs is wxPython.
Sep 28 '07 #2
Thanks!
Now i'm using Wing IDE and wxPython for GUI python coding. When i use xml.Parser.expat lib to work with XML file for build tree, it load all item in that file but i only want use the main item to build tree and other item to bind to the list.
Sep 28 '07 #3
bartonc
6,596 Expert 4TB
Thanks!
Now i'm using Wing IDE and wxPython for GUI python coding. When i use xml.Parser.expat lib to work with XML file for build tree, it load all item in that file but i only want use the main item to build tree and other item to bind to the list.
Sounds like you a well on your way with the Python side of things.
This may be more of an XML skills issue. If you post some of the XML part of your code then, perhaps, we'll be able to show you how to "slice" off the part of the data that is useful to you.
Sep 30 '07 #4
Hi,
Now i give you the pic for what i want to do:




And here are my XML contents:
<?xml version="1.0">
<HTTP>
<HTTP_01>
<Run>"1"</Run>
<TestCases>"HTTP_01.........."</TestCases>
<Result>"N/A"</Result>
<Comments>""</Comments>
<HTTP_02>
<Run>"1"</Run>
<TestCases>"HTTP_02.........."</TestCases>
<Result>"N/A"</Result>
<Comments>""</Comments>
<HTTP_03>
<Run>"1"</Run>
<TestCases>"HTTP_03.........."</TestCases>
<Result>"N/A"</Result>
<Comments>""</Comments>
</HTTP>


So, what should i do?

Thanks,
Oct 1 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

10 posts views Thread by Douglas Buchanan | last post: by
10 posts views Thread by dwok | last post: by
5 posts views Thread by Pavan | last post: by
1 post views Thread by w.p. | last post: by
1 post views Thread by jodleren | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.