[IronPython] ElementTree in IronPython

Monty Taylor monty at inaugust.com
Fri Aug 4 21:43:42 CEST 2006


ElementTree is the module containing ElementTree the class. I think
what you mean is

from elementtree.ElementTree import ElementTree
x=ElementTree()
x.parse('sample.xml')

Good luck,
Monty

On 8/3/06, Sridevi <srideviaishwariya at gmail.com> wrote:
> I need to import ElementTree into IronPython
>
>  >>> from elementtree import ElementTree
>  >>> tree = ElementTree.parse('sample.xml')
>      Traceback (most recent call last):
>      File , line 0, in <stdin>##16
>      AttributeError: 'module' object has no attribute 'parse'
>
> The parse() is a funtion in element and it has to be called.
>
> 1 .
>  >>> import sys
>  >>> sys.path.append("c:\python24\Lib")
>
>  Here the elementtree folder is in the python library
>
> 2.
>  I copied the elementtree folder into the pyIron library.
>
> Both the methods give the same error.
>
> :) ... can u help me solve the problem
>
> Thanking you,
> Sridevi
>
> _______________________________________________
> users mailing list
> users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>



More information about the Ironpython-users mailing list