ElementTree should parse string and file in teh same way
- From: "Peter Pei" <yantao@xxxxxxxxx>
- Date: Mon, 31 Dec 2007 03:42:17 GMT
One bad design about elementtree is that it has different ways parsing a string and a file, even worse they return different objects:
1) When you parse a file, you can simply call parse, which returns a elementtree, on which you can then apply xpath;
2) To parse a string (xml section), you can call XML or fromstring, but both return element instead of elementtree. This alone is bad. To make it worse, you have to create an elementtree from this element before you can utilize xpath.
.
- Follow-Ups:
- Re: ElementTree should parse string and file in the same way
- From: Stefan Behnel
- Re: ElementTree should parse string and file in teh same way
- From: Paddy
- Re: ElementTree should parse string and file in the same way
- Prev by Date: Re: Help please with code to find and move files.
- Next by Date: Re: Help please with code to find and move files.
- Previous by thread: Help please with code to find and move files.
- Next by thread: Re: ElementTree should parse string and file in teh same way
- Index(es):
Relevant Pages
|