On May 14, 7:56 pm, [EMAIL PROTECTED] wrote:
> HI,
>        The following code is for replacing the strings localid with
> "datapackageid" in an xml document.:
>
> from xml.etree.ElementTree import ElementTree as et

Note there are *two* occurrences of ElementTree in what you have
above. The first is the *module* with the parse function that that you
are looking for. The second is a *class*.

Try this:

import xml.etree.ElementTree as et
input_xml = open(file_input,'r')
tree = et.parse(input_xml)

or this:

from xml.etree.ElementTree import parse
input_xml = open(file_input,'r')
tree = parse(input_xml)




-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to