<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Elegant XML parsing using the ElementTree Module</title>
	<atom:link href="http://www.learningpython.com/2008/05/07/elegant-xml-parsing-using-the-elementtree-module/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.learningpython.com/2008/05/07/elegant-xml-parsing-using-the-elementtree-module/</link>
	<description>one man's journey into python...</description>
	<lastBuildDate>Sun, 14 Mar 2010 14:49:51 -0400</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Peter Downs</title>
		<link>http://www.learningpython.com/2008/05/07/elegant-xml-parsing-using-the-elementtree-module/comment-page-1/#comment-156241</link>
		<dc:creator>Peter Downs</dc:creator>
		<pubDate>Sun, 17 Jan 2010 06:02:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningpython.com/?p=74#comment-156241</guid>
		<description>I find it useful to define a parsing function before I do anything with XML. The parsing function will return an array of all of the elements it has found, whether they are stored as element.text or element.attrib. Here it is:

def parse_XML(element):
a = []
for subelement in element:
if subelement.text is None:
a.append(subelement.attrib)
else:
a.append(subelement.text)
return a

sorry about indentation.</description>
		<content:encoded><![CDATA[<p>I find it useful to define a parsing function before I do anything with XML. The parsing function will return an array of all of the elements it has found, whether they are stored as element.text or element.attrib. Here it is:</p>
<p>def parse_XML(element):<br />
a = []<br />
for subelement in element:<br />
if subelement.text is None:<br />
a.append(subelement.attrib)<br />
else:<br />
a.append(subelement.text)<br />
return a</p>
<p>sorry about indentation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aaron Calderon</title>
		<link>http://www.learningpython.com/2008/05/07/elegant-xml-parsing-using-the-elementtree-module/comment-page-1/#comment-154930</link>
		<dc:creator>Aaron Calderon</dc:creator>
		<pubDate>Fri, 18 Dec 2009 21:34:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningpython.com/?p=74#comment-154930</guid>
		<description>This xml reading/writing tutorial is very helpful. I think I can use it to work with the Wine tutorial series that you have.

Thanks again for your grate work.</description>
		<content:encoded><![CDATA[<p>This xml reading/writing tutorial is very helpful. I think I can use it to work with the Wine tutorial series that you have.</p>
<p>Thanks again for your grate work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nml</title>
		<link>http://www.learningpython.com/2008/05/07/elegant-xml-parsing-using-the-elementtree-module/comment-page-1/#comment-154524</link>
		<dc:creator>nml</dc:creator>
		<pubDate>Tue, 08 Dec 2009 13:05:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningpython.com/?p=74#comment-154524</guid>
		<description>Really cool tutorial</description>
		<content:encoded><![CDATA[<p>Really cool tutorial</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Artellos.com Blog &#187; Using Python to access the RolePlayGateway API</title>
		<link>http://www.learningpython.com/2008/05/07/elegant-xml-parsing-using-the-elementtree-module/comment-page-1/#comment-146740</link>
		<dc:creator>Artellos.com Blog &#187; Using Python to access the RolePlayGateway API</dc:creator>
		<pubDate>Mon, 08 Jun 2009 17:15:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningpython.com/?p=74#comment-146740</guid>
		<description>[...] of the site, Eric Martindale, who is actively maintaining RolePlayGateway. Actually accessing and manipulating XML in python was easier then I thought it would be and bringing it into practice was a lot of fun. With a bit of [...]</description>
		<content:encoded><![CDATA[<p>[...] of the site, Eric Martindale, who is actively maintaining RolePlayGateway. Actually accessing and manipulating XML in python was easier then I thought it would be and bringing it into practice was a lot of fun. With a bit of [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Raja</title>
		<link>http://www.learningpython.com/2008/05/07/elegant-xml-parsing-using-the-elementtree-module/comment-page-1/#comment-140763</link>
		<dc:creator>Raja</dc:creator>
		<pubDate>Sun, 29 Mar 2009 06:36:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningpython.com/?p=74#comment-140763</guid>
		<description>Awesome tutorial. thanks</description>
		<content:encoded><![CDATA[<p>Awesome tutorial. thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Python to CUAHSI WaterML &#38; WaterOneFlow web service, Pt. 1 &#171; Mi estero</title>
		<link>http://www.learningpython.com/2008/05/07/elegant-xml-parsing-using-the-elementtree-module/comment-page-1/#comment-135131</link>
		<dc:creator>Python to CUAHSI WaterML &#38; WaterOneFlow web service, Pt. 1 &#171; Mi estero</dc:creator>
		<pubDate>Thu, 12 Feb 2009 18:41:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningpython.com/?p=74#comment-135131</guid>
		<description>[...] with Python 2.5, ElementTree comes as part of the standard library, pre-installed. ElementTree &#8220;treats XML data as a lists of lists&#8221;, and is widely considered a more intituitive and pythonic way of processing XML, working seamlessly [...]</description>
		<content:encoded><![CDATA[<p>[...] with Python 2.5, ElementTree comes as part of the standard library, pre-installed. ElementTree &#8220;treats XML data as a lists of lists&#8221;, and is widely considered a more intituitive and pythonic way of processing XML, working seamlessly [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ankur</title>
		<link>http://www.learningpython.com/2008/05/07/elegant-xml-parsing-using-the-elementtree-module/comment-page-1/#comment-124726</link>
		<dc:creator>Ankur</dc:creator>
		<pubDate>Sun, 09 Nov 2008 04:39:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningpython.com/?p=74#comment-124726</guid>
		<description>An elegantly written article. Thank you Sir !</description>
		<content:encoded><![CDATA[<p>An elegantly written article. Thank you Sir !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eoin</title>
		<link>http://www.learningpython.com/2008/05/07/elegant-xml-parsing-using-the-elementtree-module/comment-page-1/#comment-87178</link>
		<dc:creator>Eoin</dc:creator>
		<pubDate>Fri, 30 May 2008 17:24:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningpython.com/?p=74#comment-87178</guid>
		<description>I think your websites .htaccess has been compromised.
it is redirecting all users coming via google away from your site and to some kind of advertising site.</description>
		<content:encoded><![CDATA[<p>I think your websites .htaccess has been compromised.<br />
it is redirecting all users coming via google away from your site and to some kind of advertising site.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: georgeblunt</title>
		<link>http://www.learningpython.com/2008/05/07/elegant-xml-parsing-using-the-elementtree-module/comment-page-1/#comment-82072</link>
		<dc:creator>georgeblunt</dc:creator>
		<pubDate>Thu, 08 May 2008 13:59:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningpython.com/?p=74#comment-82072</guid>
		<description>Yes, I know about lxml.. but lxml doesn&#039;t come with the standard python package (which isn&#039;t such a huge problem, i know, but in my opinion it would be great to have xpath functionality in the standard python libs, just for convenience. The XPath API isn&#039;t such an out-of-the-world feature for an xml library)</description>
		<content:encoded><![CDATA[<p>Yes, I know about lxml.. but lxml doesn&#8217;t come with the standard python package (which isn&#8217;t such a huge problem, i know, but in my opinion it would be great to have xpath functionality in the standard python libs, just for convenience. The XPath API isn&#8217;t such an out-of-the-world feature for an xml library)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://www.learningpython.com/2008/05/07/elegant-xml-parsing-using-the-elementtree-module/comment-page-1/#comment-82056</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Thu, 08 May 2008 12:57:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningpython.com/?p=74#comment-82056</guid>
		<description>If you want to use xpath just try lxml. You can use same ElementTree api and also have access to full xpath support querying.</description>
		<content:encoded><![CDATA[<p>If you want to use xpath just try lxml. You can use same ElementTree api and also have access to full xpath support querying.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
