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

XDS: clarify the definition of the optional attribute in relation to minOccurs for fields and groups #1514

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

woutdenolf
Copy link
Contributor

@woutdenolf woutdenolf commented Nov 23, 2024

optional is only a synonym for minOccurs=0 when optional=true.

When optional is false, this must mean the opposite so minOccurs>0 since nonNegativeUnbounded (not specifying the exact value of minOccurs, we only know it is greater than 0).

@woutdenolf woutdenolf linked an issue Nov 23, 2024 that may be closed by this pull request
@@ -502,7 +502,8 @@ https://stackoverflow.com/a/48980995/1046449 -->
<xs:attribute name="optional" use="optional" type="nx:NX_BOOLEAN" default="false" >
<xs:annotation>
<xs:documentation>
A synonym for minOccurs=0.
The value "true" is equivalent to minOccurs=0 while the value
"false" is equivalent to minOccurs>0.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the choices as large as minOccurs>0? Or the only choice when false is minOccurs=1?

Copy link
Contributor Author

@woutdenolf woutdenolf Nov 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the choices as large as minOccurs>0?

Yes. Any nonNegativeUnbounded greater than zero. If it is supposed to be minOccurs=1 when optional=false then I can change that of course.

nxdl.xsd Outdated Show resolved Hide resolved
@woutdenolf woutdenolf force-pushed the 1513-xsd-questions-about-occurences branch from 609432d to d6d20f8 Compare November 25, 2024 10:02
Copy link
Contributor

@PeterC-DLS PeterC-DLS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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 this pull request may close these issues.

XSD: questions about occurences
3 participants