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

address conflict between unwritten minOccurs attribute and implementation note #292

Open
dericed opened this issue Oct 22, 2019 · 9 comments
Labels
clarifications Improve the readability and comprehension of the specs formatting Fix formating issues, rearrange the content XML Schema EBML Schema validation

Comments

@dericed
Copy link
Contributor

dericed commented Oct 22, 2019

After a change in the EBML specification to clarify this, a corresponding change may be needed in the matroska specification.

See discussion on this issue at ietf-wg-cellar/matroska-specification#272 (comment)

@robUx4 robUx4 added clarifications Improve the readability and comprehension of the specs formatting Fix formating issues, rearrange the content labels Oct 22, 2019
@robUx4
Copy link
Contributor

robUx4 commented Oct 22, 2019

A formatting like this with a special keyword <unset> should work for all cases:

minOccurs: <unset>
               see implementation notes for details
minOccurs: 1
               see implementation notes for details

@dericed
Copy link
Contributor Author

dericed commented Oct 22, 2019

This is similar to my earlier use of "see note". I'd suggest to not include brackets within the special keyword.

@robUx4
Copy link
Contributor

robUx4 commented Oct 22, 2019

As with any keyword it must not be mistaken for a value. It could be used as a string, in which case it should be around double quotes (we should mention that in the specs if not already ?). So I guess no brackets would work too. It wouldn't be confused with a string value.

@dericed
Copy link
Contributor Author

dericed commented Oct 22, 2019

The other way to address it would be to adjust this line:

If the minOccurs attribute is not present then that EBML Element has a minOccurs value of 0.

Perhaps:

If the Element has an implementation_note with a note_attribute of "minOccurs" than that implementation_note describes the minOccurs and the minOccurs attribute MUST be ignored, else if the minOccurs attribute is not present then that EBML Element has a minOccurs value of 0.

@robUx4
Copy link
Contributor

robUx4 commented Oct 22, 2019

I think it's too specific to how we use it for now. For example an element may be mandatory (minOccurs=1) by default and implementation_note specify when it's not mandatory or when it has to be found twice.

More generally I think the implementation_note should specify each value.

Not sure the value should actually be set with the "regular" value in XML Schema as it can't really be mechanically interpreted. That would be misleading.

@robUx4
Copy link
Contributor

robUx4 commented Oct 27, 2019

(replying to myself) Not setting the minOccurs means it uses the default value (0). Also the path requires an EBMLMinOccurrence, if not written it means the value is 0. There is no <unset> value.

So either we add the concept of unset value (- sign for EBMLMinOccurrence/EBMLMaxOccurrence for example) or we have to pick the best/most common default value and explain in which case the value differs in implementation_note.

I think the unset option is better because it doesn't mislead the reader and programs that would parse the path to verify the validity of an element and would have no way of parsing the human-readable text implementation_note to tell when the default value is OK or not.

@robUx4 robUx4 added the XML Schema EBML Schema validation label Oct 27, 2019
@dericed
Copy link
Contributor Author

dericed commented Oct 27, 2019

I can't remember but is there a reason to have EBMLMinOccurrence/EBMLMaxOccurrence within the path as they are redundant to the minOccurs/maxOccurs attributes?

@robUx4
Copy link
Contributor

robUx4 commented Oct 27, 2019

I do not remember either and I don't see a reason why it's needed. It actually makes parsing the path harder and the occurence can be read from other attributes in the . So I'm OK with removing it totally. Now that I can handle XSLT, I can see how easier it is to go that way. I even had to add a check so the path values match the attributes.

Removing that from the path would make an "unset" value easier to handle.

The GlobalParentOccurence would still remain as there is no other equivalent.

@dericed
Copy link
Contributor Author

dericed commented Oct 27, 2019

I agree with the idea, leave GlobalParentOccurence and remove EBMLEltOccurrence and its components, though should be careful if any documentation associated with EBMLEltOccurrence should be moved to minOccurs and maxOccurs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clarifications Improve the readability and comprehension of the specs formatting Fix formating issues, rearrange the content XML Schema EBML Schema validation
Projects
None yet
Development

No branches or pull requests

2 participants