[Tutor] Generating XML using Python
tee chwee liong
tcl76 at hotmail.com
Mon Apr 11 10:44:05 CEST 2011
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 at python.org
> From: __peter__ at 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 at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20110411/98d4978e/attachment.html>
More information about the Tutor
mailing list