Re: ElementTree.XML(string XML) and ElementTree.fromstring(string XML) not working

2009-06-26 Thread Stefan Behnel
Kee Nethery wrote: > On Jun 25, 2009, at 11:39 PM, Stefan Behnel wrote: >> parsing a >> document from a string does not have its own function, because it is >> trivial to write >> >> tree = parse(BytesIO(some_byte_string)) > > :-) Trivial for someone familiar with the language. For a newbie li

Re: ElementTree.XML(string XML) and ElementTree.fromstring(string XML) not working

2009-06-26 Thread Kee Nethery
First, thanks to everyone who responded. Figured I'd test all the suggestions and provide a response to the list. Here goes ... On Jun 25, 2009, at 7:38 PM, Nobody wrote: Why do you need an ElementTree rather than an Element? XML(string) returns the root element, as if you had used et.parse(

Re: ElementTree.XML(string XML) and ElementTree.fromstring(string XML) not working

2009-06-26 Thread Carl Banks
On Jun 25, 11:20 pm, Stefan Behnel wrote: > Carl Banks wrote: > > On Jun 25, 10:11 pm, Stefan Behnel wrote: > >> Carl Banks wrote: > Why isn't et.parse the only way to do this? Why have XML or fromstring   > at all? > >>> Because Fredrick Lundh wanted it that way.  Unlike most Python > >

Re: ElementTree.XML(string XML) and ElementTree.fromstring(string XML) not working

2009-06-25 Thread Stefan Behnel
Hi, Kee Nethery wrote: > Why isn't et.parse the only way to do this? Why have XML or fromstring > at all? Well, use cases. XML() is an alias for fromstring(), because it's convenient (and well readable) to write section = XML('A to Z') section.append(paragraphs) for XML literals in source

Re: ElementTree.XML(string XML) and ElementTree.fromstring(string XML) not working

2009-06-25 Thread Stefan Behnel
Carl Banks wrote: > On Jun 25, 10:11 pm, Stefan Behnel wrote: >> Carl Banks wrote: Why isn't et.parse the only way to do this? Why have XML or fromstring at all? >>> Because Fredrick Lundh wanted it that way. Unlike most Python >>> libraries ElementTree is under the control of one pers

Re: ElementTree.XML(string XML) and ElementTree.fromstring(string XML) not working

2009-06-25 Thread Carl Banks
On Jun 25, 10:11 pm, Stefan Behnel wrote: > Carl Banks wrote: > >> Why isn't et.parse the only way to do this? Why have XML or fromstring   > >> at all? > > > Because Fredrick Lundh wanted it that way.  Unlike most Python > > libraries ElementTree is under the control of one person, which means >

Re: ElementTree.XML(string XML) and ElementTree.fromstring(string XML) not working

2009-06-25 Thread Stefan Behnel
Carl Banks wrote: >> Why isn't et.parse the only way to do this? Why have XML or fromstring >> at all? > > Because Fredrick Lundh wanted it that way. Unlike most Python > libraries ElementTree is under the control of one person, which means > it was not designed or vetted by the community, whic

Re: ElementTree.XML(string XML) and ElementTree.fromstring(string XML) not working

2009-06-25 Thread Carl Banks
On Jun 25, 8:53 pm, Kee Nethery wrote: > On Jun 25, 2009, at 8:04 PM, Carl Banks wrote: > > A few minor > > things should be no big deal. > > True and I will eventually get past the minor quirks. As a newbie,   > figured I'd point out the difficult portions, things that conceptually   > are confus

Re: ElementTree.XML(string XML) and ElementTree.fromstring(string XML) not working

2009-06-25 Thread Kee Nethery
thank you to everyone, I'll play with these suggestions tomorrow at work and report back. On Jun 25, 2009, at 8:04 PM, Carl Banks wrote: Because Fredrick Lundh wanted it that way. Unlike most Python libraries ElementTree is under the control of one person, which means it was not designed or

Re: ElementTree.XML(string XML) and ElementTree.fromstring(string XML) not working

2009-06-25 Thread Carl Banks
On Jun 25, 6:02 pm, Kee Nethery wrote: > Summary: I have XML as string and I want to pull it into ElementTree   > so that I can play with it but it is not working for me. XML and   > fromstring when used with a string do not do the same thing as parse   > does with a file. How do I get this to wor

Re: ElementTree.XML(string XML) and ElementTree.fromstring(string XML) not working

2009-06-25 Thread unayok
On Jun 25, 9:02 pm, Kee Nethery wrote: > Summary: I have XML as string and I want to pull it into ElementTree > so that I can play with it but it is not working for me. XML and > fromstring when used with a string do not do the same thing as parse > does with a file. How do I get this to work? > >

Re: ElementTree.XML(string XML) and ElementTree.fromstring(string XML) not working

2009-06-25 Thread Nobody
On Thu, 25 Jun 2009 18:02:25 -0700, Kee Nethery wrote: > Summary: I have XML as string and I want to pull it into ElementTree > so that I can play with it but it is not working for me. XML and > fromstring when used with a string do not do the same thing as parse > does with a file. How do I

ElementTree.XML(string XML) and ElementTree.fromstring(string XML) not working

2009-06-25 Thread Kee Nethery
Summary: I have XML as string and I want to pull it into ElementTree so that I can play with it but it is not working for me. XML and fromstring when used with a string do not do the same thing as parse does with a file. How do I get this to work? Details: I have a CGI that receives XML via