On Jan 28, 7:46 pm, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > At Sunday 28/1/2007 11:28, Kent Tenney wrote: > > >I want to generate the following file; > > ><?xml version="1.0" encoding="utf-8"?> > ><?xml-stylesheet mystyle?> > ><leo_file>stuff</leo_file> > > >How should I be doing this?open("filename","w").write('<?xml version="1.0" > >encoding="utf-8"?>\n' > '<?xml-stylesheet mystyle?>\n' > '<leo_file>stuff</leo_file>\n')
Right. I can use ElementTree.write('filename') and prepend the instructions to the resulting file. It leaves me curious as to the purpose/usage of ProcessingInstruction() Thanks, Kent > > :) > > >As far as I can tell, ElementTree() requires everything > >to be inside the root element (leo_file)Just keep the first two lines on my > >example... > > -- > Gabriel Genellina > Softlab SRL > > __________________________________________________ > Preguntá. Respondé. Descubrí. > Todo lo que querías saber, y lo que ni imaginabas, > está en Yahoo! Respuestas (Beta). > ¡Probalo ya!http://www.yahoo.com.ar/respuestas -- http://mail.python.org/mailman/listinfo/python-list