sorry for lack of details. yes i would like to output in 1 xml file. i would like to generate port 1 and its details (link, speed etc) then move to second port, port 2 and generate its details (link, speed etc) tq > To: tutor@python.org > From: __pete...@web.de > Date: Mon, 11 Apr 2011 10:39:48 +0200 > Subject: Re: [Tutor] Generating XML using Python > > tee chwee liong wrote: > > > thanks for your reply. seems that xml doesnt accept a space in between. > > anyway, the output generated is: > > > > - <Test> > > > > > > - <Default_Config Port="8"> > > > > > > <LINK>2</LINK> > > > > <Target_Speed>3</Target_Speed> > > </Default_Config> > > </Test> > > > > it overwrites every time the port number is incremented and only capture > > the last iteration number. how can i modify it to capture all the > > iteration? > > Do you want them all in one file? Move the code to create the root element > and the code to write the file out of the loop. > > Do you want to write multiple files? Use a different name from every file. > > _______________________________________________ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > http://mail.python.org/mailman/listinfo/tutor
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor