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

XJC should preserve XML entities in generated JavaDoc #1826

Open
Lukiz opened this issue Jan 14, 2025 · 0 comments
Open

XJC should preserve XML entities in generated JavaDoc #1826

Lukiz opened this issue Jan 14, 2025 · 0 comments

Comments

@Lukiz
Copy link

Lukiz commented Jan 14, 2025

I have xsd that that looks like this sample:

<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="Data">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="Age" type="xs:unsignedByte" />
                <xs:element name="Under18" type="xs:boolean" >
                    <xs:annotation>
                        <xs:documentation>Resolve age &lt;&gt; 18</xs:documentation>
                    </xs:annotation>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>

After generating java code the entity for less-then sign &lt; is not preserved as escaped entity but replaced with proper character <.

    /**
     * Resolve age <> 18
     * 
     */
    @XmlElement(name = "Under18")
    protected boolean under18;

It leads to invalid HTML. Our project has check for valid JavaDoc and fails on malformed HTML.

I expect that XML entities like &amp; &lt; &gt; &apos; and &quot; are preserved in JavaDoc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant