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

"refid" attribute on "includes" (incType) XML nodes should be marked optional #10212

Closed
michaeljones opened this issue Aug 4, 2023 · 4 comments
Labels
bug XML XML Output

Comments

@michaeljones
Copy link
Contributor

Describe the bug
The incType refid attribute is not marked with use="optional".

<xsd:complexType name="incType">
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attribute name="refid" type="xsd:string" />
<xsd:attribute name="local" type="DoxBool" />
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>

Expected behavior
It is marked with use="optional" as it is only written conditionally:

doxygen/src/xmlgen.cpp

Lines 1290 to 1293 in 682b594

if (ii->fileDef && !ii->fileDef->isReference()) // TODO: support external references
{
t << " refid=\"" << ii->fileDef->getOutputFileBase() << "\"";
}

Screenshots
None.

To Reproduce
The issue is visible when creating a parser for the XML based on the XSD which expects non-optional attributes to be there. This is done in Rust as part of the Docleaf project: https://github.com/docleaf-labs/docleaf

Version
I'm using 1.9.7 locally but the issue is visible in the code on main (if I correct in my interpretation of the code/xsd.)

Stack trace
None

Additional context
None

albert-github added a commit to albert-github/doxygen that referenced this issue Aug 4, 2023
…es should be marked optional

The refid is conditionally added so this should also be reflected in the xsd file
@albert-github
Copy link
Collaborator

Sounds all very reasonable.
Please always add an example showing the problem, so we can reproduce the problem.
Based on the description given: I've just pushed a proposed patch, pull request #10214

@albert-github albert-github added bug XML XML Output labels Aug 4, 2023
@michaeljones
Copy link
Contributor Author

Yeah, fair. I encountered the code in a somewhat complex set up and lazily hoped the code references would be enough. Sorry about that.

If you look at xml/example_8h.xml in the attached zip file, you'll see line 5 is:

<includes local="yes">my_other_file.h</includes>

Which is an includes tag without a refid. I assume it happens for any inclusion of a file that is outside of the Doxygen code base or that Doxygen can't find.

includes-xml-refid-error.zip

doxygen added a commit that referenced this issue Aug 18, 2023
issue #10212 "refid" attribute on "includes" (incType) XML nodes should be marked optional
@albert-github albert-github added the fixed but not released Bug is fixed in github, but still needs to make its way to an official release label Aug 18, 2023
@albert-github
Copy link
Collaborator

Code has been integrated in master on GitHub (please don't close the issue as this will be done at the moment of an official release).

@doxygen
Copy link
Owner

doxygen commented Aug 25, 2023

This issue was previously marked 'fixed but not released',
which means it should be fixed in doxygen version 1.9.8.
Please verify if this is indeed the case. Reopen the
issue if you think it is not fixed and please include any additional information
that you think can be relevant (preferably in the form of a self-contained example).

@doxygen doxygen removed the fixed but not released Bug is fixed in github, but still needs to make its way to an official release label Aug 25, 2023
@doxygen doxygen closed this as completed Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug XML XML Output
Projects
None yet
Development

No branches or pull requests

4 participants
@michaeljones @doxygen @albert-github and others