Hi everyone,<br>There seems to be an inconsistency in the ElementTree class between CPython and IronPython.<br><br>In CPython 2.6.4:<br><br><b><span style="font-family: courier new,monospace;">Python 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit (Intel)] on</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">win32</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&gt;&gt;&gt; import xml.etree.ElementTree as etree</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&gt;&gt;&gt; xml_str = &quot;&lt;Message&gt;&lt;User&gt;David&lt;/User&gt;&lt;Phone&gt;123-4567&lt;/Phone&gt;&lt;/Message&gt;&quot;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&gt;&gt;&gt; xml = etree.XML(xml_str)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&gt;&gt;&gt; print xml.find(&quot;Phone&quot;).text</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">123-4567</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&gt;&gt;&gt;</span><br style="font-family: courier new,monospace;">
</b><br><br>In IronPython 2.6.1:<br><br><b><span style="font-family: courier new,monospace;">IronPython 2.6.1 (2.6.10920.0) on .NET 2.0.50727.3603</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&gt;&gt;&gt; import xml.etree.ElementTree as etree</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&gt;&gt;&gt; xml_str = &quot;&lt;Message&gt;&lt;User&gt;David&lt;/User&gt;&lt;Phone&gt;123-4567&lt;/Phone&gt;&lt;/Message&gt;&quot;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&gt;&gt;&gt; xml = etree.XML(xml_str)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Traceback (most recent call last):</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">  File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  File &quot;C:\Program Files\IronPython 2.6\Lib\xml\etree\ElementTree.py&quot;, line 962,</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> in XML</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  File &quot;C:\Program Files\IronPython 2.6\Lib\xml\etree\ElementTree.py&quot;, line 1117</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">, in __init__</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">ImportError: No module named expat; use SimpleXMLTreeBuilder instead</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&gt;&gt;&gt; xml = etree.fromstring(xml_str)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Traceback (most recent call last):</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">  File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  File &quot;C:\Program Files\IronPython 2.6\Lib\xml\etree\ElementTree.py&quot;, line 962,</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> in XML</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  File &quot;C:\Program Files\IronPython 2.6\Lib\xml\etree\ElementTree.py&quot;, line 1117</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">, in __init__</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">ImportError: No module named expat; use SimpleXMLTreeBuilder instead</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&gt;&gt;&gt;</span><br></b><br><br>So both XML and fromstring fail to parse the xml string. Is this a bug?<br><br>