Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix the issue when we have multiple top level tags i.e. library #119

Open
wants to merge 1 commit into
base: noetic-devel
Choose a base branch
from

Conversation

hank880907
Copy link

Handle multiple top-level tags in XML nodelet files

This pull request addresses a bug found when parsing XML nodelet files that contain multiple top-level tags, which is not allowed in XML documents. The bug results in an ExpatError being raised by the xml.dom.minidom module.

In the proposed changes, we handle this scenario by reading the entire XML file into a string and manually adding a single root tag around it before parsing. This ensures that the resulting XML content always has exactly one root element, thus preventing the ExpatError.

By making this change, the script can now successfully parse XML nodelet files with multiple top-level tags, which improves its robustness and usability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant