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: [xml.minidom] Missing component in table after getElementsByTagName("nn")
Type: behavior Stage:
Components: Versions: Python 3.6
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: MiKr41, serhiy.storchaka, xtreak
Priority: normal Keywords:

Created on 2019-01-14 13:28 by MiKr41, last changed 2022-04-11 14:59 by admin.

Files
File name Uploaded Description Edit
EbsService.wsdl MiKr41, 2019-01-14 13:28 wsdl file
unnamed MiKr41, 2019-01-14 14:43
Messages (4)
msg333621 - (view) Author: Michael Krötlinger (MiKr41) Date: 2019-01-14 13:28
After operations = xmltree.getElementsByTagName("operation") the table does not contain operations antragstypenErmitteln and mammographieIndikationenErmitteln
msg333623 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2019-01-14 14:04
Thanks for the report. Please post a minimal code snippet with what you are expecting and the actual output of the program explaining the problem and how it's a bug in Python and not the actual code's logic.
msg333625 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2019-01-14 14:51
Please do not post a large amount of text as a message. This would make communication harder.
msg333626 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2019-01-14 15:10
It seems you have added a reply with the program at https://bugs.python.org/file48049/unnamed but it's filled with escaped HTML I hope. I assume you have a problem that there are 34 items with 'operation name' under grep and in the program it causes IndexError on 30th item.

# Download the file

➜  backups $ wget https://bugs.python.org/file48048/EbsService.wsdl

# Sample program 

➜  backups $ cat bpo35736.py
from xml.dom import minidom
xmldoc = minidom.parse('EbsService.wsdl')
operations = xmldoc.getElementsByTagName("operation")

for s in operations:
    print(s.attributes['name'].value)

# The text reported in the original report
➜  backups $ python3.7 bpo35736.py | grep mammographieIndikationenErmitteln
mammographieIndikationenErmitteln
mammographieIndikationenErmitteln

# Run the program and there are 34 items
➜  backups $ python3.7 bpo35736.py | wc -l
      34
➜  backups $ grep 'operation name' EbsService.wsdl | wc -l
      34


Please try attaching the program as a message or file complete with imports so that I can run on my computer. From my initial program above this doesn't seem to be a bug with xml.etree and more of a logic problem with the code.

Thanks
History
Date User Action Args
2022-04-11 14:59:10adminsetgithub: 79917
2019-01-15 17:47:38brett.cannonsettitle: Missing component in table after getElementsByTagName("nn") -> [xml.minidom] Missing component in table after getElementsByTagName("nn")
2019-01-14 15:10:49xtreaksetmessages: + msg333626
2019-01-14 14:51:17serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg333625
2019-01-14 14:49:18serhiy.storchakasetmessages: - msg333624
2019-01-14 14:43:53MiKr41setfiles: + unnamed

messages: + msg333624
2019-01-14 14:04:23xtreaksetnosy: + xtreak
messages: + msg333623
2019-01-14 13:28:08MiKr41create