Suggested fix for #206: processing error on doxygen 1.9.x XML output #207
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Doxygen since 1.9.x outputs an XML-file "Doxyfile.xml" whose root element is "doxyfile" (instead of "doxygen") and its schema info refers to "doxyfile.xsd" (instead of "compound.xsd). The root element has no "compounddef" element as first child.
AFAIR this breaks m-css's document compilation with doxygen 1.9.x.
m-css processes every XML-file in doxygen's output directory by name-globbing, regardless of the file's name or content. (I did not test it but I would expect the current processing to fail if any deviating XML files are added in the directory.)
extract_metadata()
assumes that each XML-file contains an element 'compounddef' and fails otherwise (except for index.xml, which is explicitly checked for).Two assertions would also fail in
parse_xml()
if the root element of the parsed XML-file is not 'doxygen' or the file is not index.xml (or no 'compounddef' is present).I would like to suggest that in case the input XML turns out to be unexpected, just discard the current file but proceed with the next input file.
The patch I would like to propose just replaces the two assertions in
parse_xml()
with a clause that just skips the current input file (at least this was the intention). I also added a similar skip-clause inextract_metadata()
that just discards the input if no 'compounddef' element is present. This should also make it at least a little harder for m-css to fail just because of unexpected XML files in the doxygen output directory.Proposes fix #206