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

The alternativeTitlesDomain.rng declares the 'title-role' attribute as required #915

Open
takesson opened this issue Apr 29, 2024 · 1 comment · May be fixed by #936
Open

The alternativeTitlesDomain.rng declares the 'title-role' attribute as required #915

takesson opened this issue Apr 29, 2024 · 1 comment · May be fixed by #936

Comments

@takesson
Copy link

The alternativeTitlesDomain.rng declares the 'title-role' attribute as required and with a default value. This has 2 negative side-effects:

  • Editors (e.g. Oxygen) might add the 'title-role' attribute when creating an element like 'titlehint'. That's typically not necessary nor desirable.
  • Trang will omit the default value when converting RNG to XSD (perhaps also to DTD). The attribute will be required but without the default value.

Declaring title-role attribute as required is inconsistent with most other attributes with a default value.

Thanks!

@raducoravu
Copy link

Editors (e.g. Oxygen) might add the 'title-role' attribute when creating an element like 'titlehint'. That's typically not necessary nor desirable.

I tested and Oxygen indeed inserts the attribute like this:

 <navtitle title-role="navigation"></navtitle>

Oxygen would not insert in general the default value of an attribute but in this case the attribute is considered required. I have not seen many situations where an attribute is considered both required and also has a default value in the schema, usually it's either one or the other.
For example if the attribute would be defined as optional in the RNG, then Oxygen would no longer feel compelled to insert it:

        <define name="navtitle.attributes">
            <optional>
                <attribute name="title-role" a:defaultValue="navigation"/>
            </optional>

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

Successfully merging a pull request may close this issue.

2 participants