Skip to content

Commit

Permalink
fix: Ignore non-standard content after the first root. (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
elenakrittik authored Sep 19, 2023
1 parent 29d6270 commit 901098e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions addons/godot_xml/xml.gd
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ static func _parse(xml: PackedByteArray) -> XMLDocument:
queue.back().children.append(node)
elif node_type == XMLParser.NODE_ELEMENT_END and not node.standalone:
queue.pop_back()

if queue.is_empty():
break # Ignore anything after the root is closed (multiple roots for example)
else:
queue.back().children.append(node)
queue.append(node)
Expand Down

0 comments on commit 901098e

Please sign in to comment.