Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

xml using python

Status
Not open for further replies.

sohotron

Programmer
Apr 6, 2006
1
0
0
CA
I'm trying to create some xml using python and DOM.
the structure is:

item.createNode('one/two', {
'three' :{
'four' :{ [k for k in somelist],
},
},
)

the out put is:
<one>
<two>
<three>
<four>item1</four>
<four>item2</four>
<four>item3</four>
</three>
</two>
</one>

now i want it to be this way:
<one>
<two>
<three>
<four>item1</four>
</three>
<three>
<four>item2</four>
</three>
<three>
<four>item3</four>
</three>
</two>
<one>

How can I make it happen?
Anybody knows?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top