Created
October 24, 2010 17:22
-
-
Save anonymous/643697 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" Sample XML 2 """ | |
<default_project0 name="default_project0"> | |
<OBJECT_REPOSITORY name="OBJECT_REPOSITORY"> | |
<pageName name="pageName" > | |
<page_objects_0 name="page_objects_0"> | |
<a/> | |
<b> | |
<b1> | |
<c1b1> | |
<child_c1b1> | |
</child_c1b1> | |
<c1b1> | |
</b1> | |
</b> | |
<d/> | |
</page_objects_0> | |
</pageName> | |
</OBJECT_REPOSITORY> | |
</default_project0> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" Logic""" | |
self.workspace_tree=ET.parse(file_object) | |
root=self.workspace_tree.getroot() | |
for i in list(root): | |
child1=self.tree.AppendItem(parent,i.get('name')) | |
for j in list(i): | |
child2=self.tree.AppendItem(child1,j.get('name')) | |
for k in list(j): | |
child3=self.tree.AppendItem(child2,k.get('name')) | |
for l in list(k): | |
child4=self.tree.AppendItem(child3,l.get('name')) | |
for m in list(l): | |
child5=self.tree.AppendItem(child4,m.get('name')) | |
for n in list(m): | |
child6=self.tree.AppendItem(child5,n.get('name')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" Sample XML 1 """ | |
<default_project0 name="default_project0"> | |
<OBJECT_REPOSITORY name="OBJECT_REPOSITORY"> | |
<pageName name="pageName" > | |
<page_objects_0 name="page_objects_0"> | |
<a/> | |
<b> | |
<b1> | |
<c1b1/> | |
</b1> | |
</b> | |
<d/> | |
</page_objects_0> | |
</pageName> | |
</OBJECT_REPOSITORY> | |
</default_project0> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment