classification
Title: Minidom: parsestring() error
Type: crash Stage:
Components: XML Versions: Python 2.6
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, naf305
Priority: normal Keywords:

Created on 2009-04-29 04:44 by naf305, last changed 2009-04-29 06:54 by georg.brandl. This issue is now closed.

Messages (2)
msg86776 - (view) Author: Nicolas Frantzen (naf305) Date: 2009-04-29 04:43
Hi,

I'm pretty new to the community but I get an error using the minidom
parseString() method. Here is my code (ulta simple!):

import xml.dom.minidom
xml = "<tag>hello</tag>"
doc = xml.dom.minidom.parsString(xml)

And here is my error trace:

Traceback (most recent call last):
  File "C:\test.py", line 6, in <module>
    doc = xml.dom.minidom.parsString(xml)
AttributeError: 'str' object has no attribute 'dom'

I get this error no what string I gave it. I use python 2.6 (latest
stable release).

Can someone point in the right direction...google has not been very helpful.

Thanks!

Nico
msg86777 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2009-04-29 06:54
You'll have to name your string differently; you can't have "xml" refer
to both the string and the package :)

Please refer to python-list or the comp.lang.python newsgroup for
further usage questions.
History
Date User Action Args
2009-04-29 06:54:34georg.brandlsetstatus: open -> closed

nosy: + georg.brandl
messages: + msg86777

resolution: not a bug
2009-04-29 04:44:08naf305create