sphinx-doc / sphinx

The Sphinx documentation generator
https://www.sphinx-doc.org/
Other
6.54k stars 2.12k forks source link

Parsing Error in Compound.py #6523

Closed ZanderUF closed 5 years ago

ZanderUF commented 5 years ago

Describe the bug I am using Breathe to connect Sphinx and Doxygen. I am getting an exception error when trying to parse part of an XML file generated by Doxygen. If this bug report should be put in a different spot I apologize.

To Reproduce Steps to reproduce the behavior:

$ cd project_dir
$ sphinx-build -b html ./source ./build

Traceback (most recent call last): File "c:\program files (x86)\intelswtools\intelpython3\lib\site-packages\breathe\parser__init__.py", line 84, in parse return self.cache[filename] KeyError: 'P:/Edmonds/Zander/All_Previous_Versions_EFDCPlus/085_OMP/Working/Doxygen/docs_doxy/xml\calpser_8f90.xml'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\program files (x86)\intelswtools\intelpython3\lib\site-packages\breathe\parser\compound.py", line 1067, in parse
    doc = minidom.parse(inFilename)
  File "c:\program files (x86)\intelswtools\intelpython3\lib\xml\dom\minidom.py", line 1958, in parse
    return expatbuilder.parse(file)
  File "c:\program files (x86)\intelswtools\intelpython3\lib\xml\dom\expatbuilder.py", line 911, in parse
    result = builder.parseFile(fp)
  File "c:\program files (x86)\intelswtools\intelpython3\lib\xml\dom\expatbuilder.py", line 207, in parseFile
    parser.Parse(buffer, 0)
xml.parsers.expat.ExpatError: not well-formed (invalid token): line 64, column 138

Line 64 of calpser_8f90.xml is: <codeline lineno="40"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/ </highlight><highlight class="comment">!<sp/>***<sp/>CATMULL–ROM<sp/>SPLINE</highlight><highlight class="normal"></highlight></codeline>

!**METHOD1:COURANT–FRIEDRICHS–LEWY

When I remove this line from the XML file the parsing error goes away and everything is built as expected.

Expected behavior The XML will be parsed correctly.

Environment info

tk0miya commented 5 years ago

It seems the error was raised from breathe extension. So this is not a bug of Sphinx. Please ask this to their project.

I'm not good at breathe, but it seems the XML file you pasted is broken; the sp tag before highlight closer tag is not closed correctly:<sp/><sp/ </highlight>. I don't know why such broken XML was generated, but this is also not a bug of breathe, I think.

tk0miya commented 5 years ago

I'm closing this because not a bug of Sphinx. Thanks,