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

Add an XSD #273

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

Add an XSD #273

wants to merge 10 commits into from

Conversation

nigelmegitt
Copy link
Contributor

@nigelmegitt nigelmegitt commented Nov 15, 2024

Closes #272 by adding an XSD based on the TTML2 XSD (by copy rather than reference) and making additions and modifications as needed to meet the constraints of DAPT.

With thanks to @magicbadger for his help and content while developing this.

Also define restrictions (prohibited and required attributes) properly.
@nigelmegitt nigelmegitt added documentation Improvements or additions to documentation editorial labels Nov 15, 2024
@himorin
Copy link
Contributor

himorin commented Nov 18, 2024

just note, all http://www.w3.org/ns are automatically redirected to https
might not cause error over tooling (per past survey on whole ns redirection), but leave comment here just to note.

@nigelmegitt
Copy link
Contributor Author

just note, all http://www.w3.org/ns are automatically redirected to https might not cause error over tooling (per past survey on whole ns redirection), but leave comment here just to note.

Are you suggesting that the Namespaces in the spec should be changed to https (which would be a separate issue)? I don't think there's any requirement that anyone or any implementation actually fetches the resource at the URL, and certainly I don't expect the XSD to cause that. I'd just like to know more about what concerns there might be about the https redirect.

Was too heavy handed before in removing them, I think they are permitted in DAPT. But out of line animation still isn't allowed!
Explain the structure of the XSD, and how to use it.
Also sort DAPT metadata by attributes and then elements , each alphabetically.

EBU-TT Metadata is imported by git submodule.
@nigelmegitt nigelmegitt added the agenda Issue flagged for in-meeting discussion label Dec 2, 2024
@cconcolato
Copy link
Contributor

@nigelmegitt we have been testing with some XML output of our TTAL converter and getting some errors like:

file.xml:33: element layout: Schemas validity error : Element '{http://www.w3.org/ns/ttml}layout': This element is not expected.
file.xml:41: element div: Schemas validity error : Element '{http://www.w3.org/ns/ttml}div', attribute '{http://www.w3.org/ns/ttml/profile/dapt#metadata}onScreen': The attribute '{http://www.w3.org/ns/ttml/profile/dapt#metadata}onScreen' is not allowed.
file.xml:41: element div: Schemas validity error : Element '{http://www.w3.org/ns/ttml}div', attribute 'region': The attribute 'region' is not allowed.

My memory of XSD is blurry but looking at the schemas, I don't see where onScreen is explicitly allowed on div for example.

@nigelmegitt
Copy link
Contributor Author

Thanks @cconcolato , looks like I was too keen on stripping out TTML2 region binding that we didn't mean to prohibit, so I have restored that in ff2d5ca. Also explicitly added daptm:onScreen to <div>.

I can't reproduce the unexpected layout element error, so if that persists for you, please could you share the document that's failing validation?

@css-meeting-bot
Copy link
Member

The Timed Text Working Group just discussed Add an XSD w3c/dapt#273, and agreed to the following:

  • SUMMARY: @nigelmegitt to remove dapt-all and modify the README to match
The full IRC log of that discussion <nigel> Subtopic: Add an XSD #273
<nigel> github: https://github.com//pull/273
<nigel> Nigel: I opened this PR on 15th November
<nigel> .. It adds an XML Schema 1.0 XSD to the DAPT repo
<nigel> .. No change to the spec. Not normative, just editorial.
<nigel> .. But useful nonetheless.
<nigel> .. Cyril, you tried it and found some issues, which I think I've fixed.
<nigel> .. How's it looking?
<nigel> Cyril: I haven't had a chance to test the latest fixes but they probably will work.
<nigel> .. My feedback is: I misunderstood at first when I looked at the folder.
<nigel> .. I thought the TTML ones were pure copies, but you've actually modified them.
<nigel> .. Would be good to have a README or a description.
<nigel> Nigel: I actually added a README for that exact reason!
<nigel> Cyril: Oh, fine, I should have looked!
<nigel> Nigel: I agree, it could catch people out.
<nigel> .. Also the need to check out recursively because it uses a git submodule for the EBU-TT metadata.
<nigel> Cyril: Does that have an example or a list of tools that could be used?
<nigel> .. I used XMLLint and it would not recognise some constructs in the XSD so I had to change.
<nigel> Nigel: Do you know what it didn't recognise?
<nigel> Cyril: There was a dapt.xsd and a dapt-all.xsd, and the dapt-all uses a mix of include and import.
<nigel> .. I had to use the dapt.xsd.
<nigel> Nigel: Ah, dapt-all brings other XSDs in by namespace alone and depends on your tool config.
<nigel> .. Maybe we should remove dapt-all.
<nigel> Cyril: Would it produce false positives or false negatives?
<nigel> Nigel: If your tool is configured to point at the unmodified TTML XSDs for the TTML namespace then
<nigel> .. it might successfully validate constructs that are prohibited in DAPT.
<nigel> Cyril: I'd agree with your suggestion to remove dapt-all then.
<nigel> Nigel: I used XSD 1.0 because there are more free tools available that use it.
<nigel> .. It's restricted compared to XSD 1.1 and makes it harder to constrain or apply additional rules
<nigel> .. based on an unmodified TTML XSD.
<nigel> SUMMARY: @nigelmegitt to remove dapt-all and modify the README to match
<nigel> [group discussion of the merits of different types of validation tool]
<nigel> Cyril: For the community in general, a validation tool is super useful.
<nigel> Nigel: Very much so, and Ben Poor from EBU's Eurovox used the XSD to find an issue with some DAPT
<nigel> .. that the tool was generating, so it showed its value within a day.

As discussed in today's TTWG meeting - notes via w3c/ttwg#296
@nigelmegitt nigelmegitt removed the agenda Issue flagged for in-meeting discussion label Dec 6, 2024
@nigelmegitt nigelmegitt added the agenda Issue flagged for in-meeting discussion label Dec 17, 2024
@nigelmegitt
Copy link
Contributor Author

nigelmegitt commented Dec 17, 2024

Agenda+ for 2024-12-19 TTWG call to see if anyone has any recommendations for validation tools or approaches using the XSD

@css-meeting-bot
Copy link
Member

The Timed Text Working Group just discussed Add an XSD w3c/dapt#273, and agreed to the following:

  • SUMMARY: @nigelmegitt to add a validator script that uses the XSD
The full IRC log of that discussion <nigel> Subtopic: Add an XSD #273
<nigel> github: https://github.com//pull/273
<nigel> Cyril: I thought there would be a quick way to run a command line tool to validate
<nigel> .. a document against an XSD.
<nigel> .. I didn't find one.
<nigel> .. Maybe we should document that for people
<nigel> Nigel: I still feel sure there are command line tools.
<nigel> .. I found a python library called xmlschema and another Java app that wraps native Java
<nigel> .. functionality that should do it.
<nigel> .. It's really easy to write a few lines of python to validate against the schema,
<nigel> .. so one option is to create a validator and put it in the repo, or in a separate repo.
<nigel> .. What's most useful here?
<nigel> Cyril: If I struggle, others would too. Obviously you can write a wrapper around a library,
<nigel> .. and people might not be confident.
<nigel> .. I agree, if you have a python wrapper it would help people.
<nigel> .. Could be in the same repo, I don't know.
<nigel> Andreas: Usually a command line utility would work. I'm not sure what's wrong with this schema.
<nigel> Cyril: I tried xmllint and it didn't work. Saxon EE may have it, but Saxon HE doesn't.
<nigel> Andreas: Saxon EE definitely, it's well known, but it's not a free tool.
<nigel> .. I can also check. As you say, it's not only an issue for DAPT but all other TTML schemas.
<nigel> .. Pierre, you are also implementing an online schema validator, right?
<nigel> Pierre: Yes, just the Java one. It's a wrapper.
<nigel> .. Very few command line validators work with more than one XSD.
<nigel> .. If you have dependencies between XSDs it's much harder.
<nigel> .. Online is best, right, because it's easiest for people to run.
<nigel> .. But a command line wrapper that includes all the XSDs and loads them properly is probably easiest for the end user.
<nigel> Nigel: If it's going to help validate the PR I can add a few lines of Python and install instructions
<nigel> .. into the repo.
<nigel> Cyril: I support that.
<nigel> SUMMARY: @nigelmegitt to add a validator script that uses the XSD
<nigel> Nigel: Any other recommendations for command line validators also very welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agenda Issue flagged for in-meeting discussion documentation Improvements or additions to documentation editorial
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add an XSD for simple validation
4 participants