Fixed bugs in Doxygen XML output

I am currently writing a parser for doxygen XML output. Partly for academic reasons and because the doxygen / addons / doxmlparser code is ancient.

I use QXmlStreamReader for XML parsing and cause errors in some attributes. For example, for doxygen, the following XML is generated:

... <listofallmembers> ... <member refid="qset_1operator&" prot="public" virt="non-virtual"><scope>libDatabase::Set</scope><name>operator&amp;</name></member> ... </listofallmembers> 

This is refid="qset_1operator&" , of course, the problem:

 XmlStreamReaderError: Expected '#' or '[a-zA-Z]', but got '"'. 

Other errors include the presence of <> characters (and others) in XML attributes.

I know that these characters should be replaced with their &lt; , &gt; etc.

How can I easily (and automatically, of course) fix XML when I cannot use the Qt classes to even look at XML?

+4
source share
1 answer

One possibility would be to circumvent the errors and fix them manually as they appear, iterate over the XML until they are correctly formed. See This Stackoverflow Question: Ignoring Invalid XML Tag Using Qdom?

You can also use the tidy library to correct input before processing.

+2
source

All Articles