Re: formatted xml output from ElementTree inconsistency

2005-06-26 Thread uche . ogbuji
Patrick Maupin wrote: """ Dennis Bieber wrote: > Off hand, I'd consider the non-binary nature to be because the > internet protocols are mostly designed for text, not binary. A document at http://www.w3.org/TR/REC-xml/ lists "the design goals for XML". One of the listed goals is "XML documents sh

Re: formatted xml output from ElementTree inconsistency

2005-06-24 Thread Patrick Maupin
Dennis Bieber wrote: > Off hand, I'd consider the non-binary nature to be because the > internet protocols are mostly designed for text, not binary. A document at http://www.w3.org/TR/REC-xml/ lists "the design goals for XML". One of the listed goals is "XML documents should be human-legible and

Re: formatted xml output from ElementTree inconsistency

2005-06-24 Thread Steven Bethard
Matthew Thorley wrote: > from elementtree import ElementTree as et > > xmla = et.ElementTree('some_file.xml') > xmlb = et.Element('parent') > et.SubElement(xmlb, 'child1') > et.SubElement(xmlb, 'child2') > > root = et.Element('root') > root.append(xmla.getroot()) > root.append(xmlb) > > print et

Re: formatted xml output from ElementTree inconsistency

2005-06-24 Thread Patrick Maupin
Jarek Zgoda wrote: > Why want you to read an XML document "by hand"? It's a "machine related" > data chunk. > I see this attitude all the time, and frankly I don't understand it. Please explain why XML is in ASCII/unicode instead of binary. Is it because it is easier for a machine to parse? No,

Re: formatted xml output from ElementTree inconsistency

2005-06-24 Thread Kent Johnson
Matthew Thorley wrote: > Greetings, perhaps someone can explain this. I get to different styles > of formatting for xmla and xmlb when I do the following: > > Is that because the some_file.xml is already nicely formatted? I thought > that the formatting was ignored when creating new elements. E

Re: formatted xml output from ElementTree inconsistency

2005-06-23 Thread Matthew Thorley
Jarek Zgoda wrote: > Matthew Thorley napisał(a): > >> The output I get shows xmla as nicely formatted text, with elements on >> different lines and everything all tabbed and pretty. Inverly, xmlb is >> one long string on one line. >> >> Is that because the some_file.xml is already nicely formatt

Re: formatted xml output from ElementTree inconsistency

2005-06-23 Thread Jarek Zgoda
Matthew Thorley napisał(a): > The output I get shows xmla as nicely formatted text, with elements on > different lines and everything all tabbed and pretty. Inverly, xmlb is > one long string on one line. > > Is that because the some_file.xml is already nicely formatted? I thought > that the f

formatted xml output from ElementTree inconsistency

2005-06-23 Thread Matthew Thorley
Greetings, perhaps someone can explain this. I get to different styles of formatting for xmla and xmlb when I do the following: from elementtree import ElementTree as et xmla = et.ElementTree('some_file.xml') xmlb = et.Element('parent') et.SubElement(xmlb, 'child1') et.SubElement(xmlb, 'child2')