You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I seemed to have encountered a bug with the Abdera conversion logic, specifically how it converts children:
for child in children:
child_data = self.data(child)
if (count[child.tag] == 1
and len(children_list) > 1
and isinstance(children_list[-1], dict)):
# Merge keys to existing dictionary
children_list[-1].update(child_data)
else:
# Add additional text
children_list.append(self.data(child))
The first child node, Services, is placed into a separate dictionary, while the rest of the children are placed in the same dictionary. Because multiple tags with the same keys can be present in XML, all children should probably be placed in separate dictionaries.
I'm working on a PR for this, but if you happen to no what the problem is, let me know.
The text was updated successfully, but these errors were encountered:
mattgd
changed the title
Abdera first child node placed in separate dictionary
Abdera child nodes incorrectly placed in same dictionaries
Jun 18, 2017
I seemed to have encountered a bug with the Abdera conversion logic, specifically how it converts children:
When given the following XML data:
I receive the following output from
ab.data(xml_file)
:The first child node,
Services
, is placed into a separate dictionary, while the rest of the children are placed in the same dictionary. Because multiple tags with the same keys can be present in XML, all children should probably be placed in separate dictionaries.I'm working on a PR for this, but if you happen to no what the problem is, let me know.
The text was updated successfully, but these errors were encountered: