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

Improve interoperability of non-negative-real and xs:decimal. #943

Closed
skynavga opened this issue Jul 30, 2018 · 8 comments · Fixed by #944
Closed

Improve interoperability of non-negative-real and xs:decimal. #943

skynavga opened this issue Jul 30, 2018 · 8 comments · Fixed by #944

Comments

@skynavga
Copy link
Collaborator

As presently defined in §10.3.27, non-negative-real includes .0 and 0.0, but does not include 0. This creates an interoperability problem with the use of xs:decimal [1] in the schema for tta:gain and tta:pan. There is no reason we should exclude 0., so I propose we change the definition of non-negative-real to the following:

non-negative-real
  : <digit>* "." <digit>+
  | <digit>+ "."

[1] https://www.w3.org/TR/xmlschema-2/#decimal

@skynavga
Copy link
Collaborator Author

In double checking on TTML1, I see that the original syntax for non-negative-real, which excludes real numbers such as 0., is also present in TTML1 1e, 2e, and 3e, where it is used to support non-integer length values. Therefore, making this proposed change in TTML2 would effectively be an extension to TTML1 syntax, but it could be handled by adding #length-real-version-2 and adding this new designator to #length-version-2.

@skynavga
Copy link
Collaborator Author

Address #943 (comment) in 2bc2855.

@skynavga
Copy link
Collaborator Author

Note further that, if we do not adopt the above proposals, then we need to change the schema datatype for tta:gain and ``tta:panfromxs:decimal` to `xs:string` in order to effectively detect the (now) invalid value expression `0.`. The reason for this is that if `xs:decimal` is used, then the expression `0.` is interned (without error) as a `BigDecimal` by JAXB, after which point it is impossible to distinguish between a valid original value of, say `0.0`, and the invalid value `0.`.

@nigelmegitt
Copy link
Contributor

This seems to be outside the review scope for the CfC; rather than making a substantive change now during the CfC period I'd prefer to defer this to a 2nd Ed.

@skynavga
Copy link
Collaborator Author

skynavga commented Aug 2, 2018

Deferring to consideration under ttml.next.

@skynavga skynavga closed this as completed Aug 2, 2018
@skynavga skynavga removed their assignment Aug 2, 2018
@skynavga skynavga added ttml.next and removed pr open labels Aug 2, 2018
@skynavga skynavga modified the milestones: CR3, 2ED Aug 30, 2018
@skynavga skynavga reopened this Aug 30, 2018
@skynavga
Copy link
Collaborator Author

skynavga commented Feb 1, 2019

Removing ttml.next, leaving here for ttml2 2e processing.

@css-meeting-bot
Copy link
Member

The Timed Text Working Group just discussed Improve interoperability of non-negative-real and xs:decimal. ttml2#943.

The full IRC log of that discussion <nigel> Topic: Improve interoperability of non-negative-real and xs:decimal. ttml2#943
<nigel> github: https://github.com//issues/943
<cyril> nigel: this issue is about allowing zero point to be valid
<cyril> ... it is not at the moment
<cyril> ... glenn's proposal is to permit it
<cyril> ... there is a PR for this
<cyril> glenn: I restarted the original PR that had been done last year
<cyril> ... I updated based on the current master
<cyril> nigel: this means that a previous non-conformant document would become conformant
<cyril> glenn: technically yes
<cyril> ... but it was never the intention to make that non-conformant
<nigel> q?
<nigel> -> https://www.w3.org/TR/xmlschema-2/#decimal xs:decimal definition
<cyril> cyril: is '0.' allowed in xs:decimal?
<cyril> cyril: it seems that it is allowed according to section "3.2.3.1 Lexical representation"
<cyril> nigel: but the fact that the . is the last character is a bit confusing
<cyril> gkatsev: but it says that trailing 0 are optional
<nigel> q+
<cyril> glenn: we changed the schema since then to use xs:string
<cyril> ... that change was based on the comment of July 21, last year
<nigel> q?
<cyril> ... we just need to widen the expression for non negative real
<cyril> nigel: this change makes non negative real, the + becomes a *?
<cyril> glenn: no it adds a new line
<cyril> ... you need the full stop to denote it's a real number
<cyril> nigel: ok, it makes sense
<cyril> ... the idea of making non negative real coincident with xs:decimal makes sense
<cyril> ... it makes it easier to write the schema
<cyril> ... seems like a good change to me
<cyril> cyril: is it affecting only gain and pan?
<cyril> nigel: a lot of things
<cyril> ... lengths, gain, pan, ...
<cyril> ... pitch, percentage uses number
<cyril> ... a lot of things would be affected by this
<cyril> pal: I'm looking at ttval
<cyril> ... so now non-negative real always has a dot
<cyril> ... but not a dot by itsefl
<cyril> s/itsefl/itself/
<cyril> nigel: it's good to look at implementation
<cyril> ... just checking EBU-TT impl, 1. would not match, but 1.0 would
<cyril> pal: it seems ttval would reject 0. but I need to check
<cyril> nigel: it might make some existing implementations non conformant
<cyril> ... I'm beginning to think it's a problem
<cyril> glenn: there is no requirement to backport it to TTML1
<cyril> ... it would potentially make validation tools not implementing 2nd ed more restrictive
<cyril> ... not sure what the roll out status of TTML2 in the industry
<cyril> ... but that would improve the status of interop
<cyril> nigel: that would be a change for IMSC 1.1 also
<cyril> cyril: I would say we shouldn't do syntactic changes unless it's broken
<cyril> pal: if we have several such changes, we could accumulate them and wait
<cyril> ... it would make it easier to include this one
<cyril> glenn: I'm not sure I agree that it's a breaking change
<cyril> nigel: it's not a document breaking change, but an implementation breaking change
<cyril> cyril: I think people should look at their implementations and we can take a decision based on that
<cyril> nigel: if this would be the only syntactical change, then it might not be worth
<cyril> glenn: we already approved some changes
<cyril> cyril: it would be good to have a list of those
<cyril> glenn: we changed the content body to add audio
<cyril> nigel: summary: group to study implementation impact and add review comments
<cyril> pal: and if we do it, we should have a test for that

@skynavga skynavga added the bug label Jul 22, 2019
@skynavga
Copy link
Collaborator Author

Marking this issue as a bug since the omission of support for non-negative real numbers with a lexical representation of <digit>+ "." was an oversight (since TTML1 1e).

skynavga added a commit that referenced this issue Aug 2, 2019
Improve non-negative-real interoperability (#943).
@skynavga skynavga removed their assignment Aug 2, 2019
@skynavga skynavga added pr merged and removed pr open labels Aug 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants