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

Suggested fix for #206: processing error on doxygen 1.9.x XML output #207

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions documentation/doxygen.py
Original file line number Diff line number Diff line change
Expand Up @@ -2192,6 +2192,11 @@ def extract_metadata(state: State, xml):

compounddef: ET.Element = root.find('compounddef')

# Skip XML-files without metadata (e.g. doxygen 1.9.x's Doxyfile.xml)
if compounddef is None:
logging.debug("No metadata found in {}, skipping".format(os.path.basename(xml)))
return

if compounddef.attrib['kind'] not in ['namespace', 'group', 'class', 'struct', 'union', 'dir', 'file', 'page']:
logging.debug("No useful info in {}, skipping".format(os.path.basename(xml)))
return
Expand Down Expand Up @@ -2454,10 +2459,14 @@ def parse_xml(state: State, xml: str):
return

root = tree.getroot()
assert root.tag == 'doxygen'
if root.tag != 'doxygen':
logging.debug("Root element is '{}' but should be 'doxygen', skipping".format(root.tag))
return

compounddef: ET.Element = root[0]
assert compounddef.tag == 'compounddef'
if compounddef.tag != 'compounddef':
logging.debug("First child element is '{}' but should be 'compounddef', skipping".format(compounddef.tag))
return
assert len([i for i in root]) == 1

# Ignoring private structs/classes and unnamed namespaces
Expand Down