This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

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 2022-04-11 14:56 by admin. 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
2022-04-11 14:56:48adminsetgithub: 50123
2009-04-29 06:54:34georg.brandlsetstatus: open -> closed

nosy: + georg.brandl
messages: + msg86777

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