diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..18171b9 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "xml-schemas/ebu-tt-m-xsd"] + path = xml-schemas/ebu-tt-m-xsd + url = https://github.com/ebu/ebu-tt-m-xsd.git diff --git a/schema-validator/README.md b/schema-validator/README.md new file mode 100644 index 0000000..6d355d2 --- /dev/null +++ b/schema-validator/README.md @@ -0,0 +1,35 @@ +# DAPT XSD Validator + +Basic command line utility for validating DAPT documents using +the XML Schema Definition in the w3c/dapt repository. + +This script uses the MIT licensed [`xmlschema`](https://github.com/sissaschool/xmlschema) library. + +This script is provided as-is with no warranties of any kind. +The repository's `LICENSE.md` applies, with the contents of this folder +being considered a _code example_. + +## Build + +1. Install poetry - [installation instructions](https://python-poetry.org/docs/#installing-with-the-official-installer) +2. Ensure you have a version of Python greater than or equal to 3.11 available +for example with the command `poetry env use 3.11` +3. Install the dependencies by running `poetry install` + +## Usage + +```sh +poetry run validate -dapt_in path/to/dapt_file.ttml +``` + +or pass the document for validating in via stdin, e.g.: + +```sh +poetry run validate < path/to/dapt_file.ttml +``` + +## Tests + +```sh +poetry run python -m unittest +``` diff --git a/schema-validator/poetry.lock b/schema-validator/poetry.lock new file mode 100644 index 0000000..aea010e --- /dev/null +++ b/schema-validator/poetry.lock @@ -0,0 +1,88 @@ +# This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand. + +[[package]] +name = "elementpath" +version = "4.7.0" +description = "XPath 1.0/2.0/3.0/3.1 parsers and selectors for ElementTree and lxml" +optional = false +python-versions = ">=3.8" +files = [ + {file = "elementpath-4.7.0-py3-none-any.whl", hash = "sha256:607804a1b4250ac448c1e2bfaec4ee1c980b0a07cfdb0d9057b57102038ed480"}, + {file = "elementpath-4.7.0.tar.gz", hash = "sha256:a2029dc8752fcfec49663d1ed1b412c6daf278c0c91938f50f63c4fe9ed1848e"}, +] + +[package.extras] +dev = ["Sphinx", "coverage", "flake8", "lxml", "lxml-stubs", "memory-profiler", "memray", "mypy", "tox", "xmlschema (>=3.3.2)"] + +[[package]] +name = "flake8" +version = "7.1.2" +description = "the modular source code checker: pep8 pyflakes and co" +optional = false +python-versions = ">=3.8.1" +files = [ + {file = "flake8-7.1.2-py2.py3-none-any.whl", hash = "sha256:1cbc62e65536f65e6d754dfe6f1bada7f5cf392d6f5db3c2b85892466c3e7c1a"}, + {file = "flake8-7.1.2.tar.gz", hash = "sha256:c586ffd0b41540951ae41af572e6790dbd49fc12b3aa2541685d253d9bd504bd"}, +] + +[package.dependencies] +mccabe = ">=0.7.0,<0.8.0" +pycodestyle = ">=2.12.0,<2.13.0" +pyflakes = ">=3.2.0,<3.3.0" + +[[package]] +name = "mccabe" +version = "0.7.0" +description = "McCabe checker, plugin for flake8" +optional = false +python-versions = ">=3.6" +files = [ + {file = "mccabe-0.7.0-py2.py3-none-any.whl", hash = "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"}, + {file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"}, +] + +[[package]] +name = "pycodestyle" +version = "2.12.1" +description = "Python style guide checker" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pycodestyle-2.12.1-py2.py3-none-any.whl", hash = "sha256:46f0fb92069a7c28ab7bb558f05bfc0110dac69a0cd23c61ea0040283a9d78b3"}, + {file = "pycodestyle-2.12.1.tar.gz", hash = "sha256:6838eae08bbce4f6accd5d5572075c63626a15ee3e6f842df996bf62f6d73521"}, +] + +[[package]] +name = "pyflakes" +version = "3.2.0" +description = "passive checker of Python programs" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pyflakes-3.2.0-py2.py3-none-any.whl", hash = "sha256:84b5be138a2dfbb40689ca07e2152deb896a65c3a3e24c251c5c62489568074a"}, + {file = "pyflakes-3.2.0.tar.gz", hash = "sha256:1c61603ff154621fb2a9172037d84dca3500def8c8b630657d1701f026f8af3f"}, +] + +[[package]] +name = "xmlschema" +version = "3.4.3" +description = "An XML Schema validator and decoder" +optional = false +python-versions = ">=3.8" +files = [ + {file = "xmlschema-3.4.3-py3-none-any.whl", hash = "sha256:eea4e5a1aac041b546ebe7b2eb68eb5eaebf5c5258e573cfc182375676b2e4e3"}, + {file = "xmlschema-3.4.3.tar.gz", hash = "sha256:0c638dac81c7d6c9da9a8d7544402c48cffe7ee0e13cc47fc0c18794d1395dfb"}, +] + +[package.dependencies] +elementpath = ">=4.4.0,<5.0.0" + +[package.extras] +codegen = ["elementpath (>=4.4.0,<5.0.0)", "jinja2"] +dev = ["Sphinx", "coverage", "elementpath (>=4.4.0,<5.0.0)", "flake8", "jinja2", "lxml", "lxml-stubs", "memory-profiler", "mypy", "sphinx-rtd-theme", "tox"] +docs = ["Sphinx", "elementpath (>=4.4.0,<5.0.0)", "jinja2", "sphinx-rtd-theme"] + +[metadata] +lock-version = "2.0" +python-versions = ">=3.11" +content-hash = "a6d74d71acfdd39d86fa00bb5c576c716bfdfa94dfc9e49ad24ea0e73ccd81fe" diff --git a/schema-validator/pyproject.toml b/schema-validator/pyproject.toml new file mode 100644 index 0000000..5baf9f0 --- /dev/null +++ b/schema-validator/pyproject.toml @@ -0,0 +1,24 @@ +[tool.poetry] +name = "dapt-xsd-val" +version = "0.1.0" +description = "Thin wrapper around xmlschema to support XSD validation using the supplied DAPT XSD" +authors = ["Nigel Megitt "] +readme = "README.md" +packages = [ + { include = "src" }, + { include = "test" }, +] + +[tool.poetry.dependencies] +python = ">=3.11" +xmlschema = "^3.4.3" + +[tool.poetry.group.dev.dependencies] +flake8 = "^7.1.2" + +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api" + +[tool.poetry.scripts] +validate = "src.validate:main" diff --git a/schema-validator/src/__init__.py b/schema-validator/src/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/schema-validator/src/validate.py b/schema-validator/src/validate.py new file mode 100644 index 0000000..ee36a32 --- /dev/null +++ b/schema-validator/src/validate.py @@ -0,0 +1,68 @@ +import os +import sys +import argparse +import xmlschema +import logging + +logging.getLogger().setLevel(logging.INFO) + + +schema_path = os.path.normpath( + os.path.join( + os.path.dirname(__file__), + '../../xml-schemas/dapt.xsd') +) +metadata_items_schema_path = os.path.normpath( + os.path.join( + os.path.dirname(__file__), + '../../xml-schemas/ttml2-metadata-items.xsd') +) + + +def validate_dapt(args): + # xmlschema gets baffled following the import of metadata_items, + # so make it load it explicitly instead, which seems to work. + schema_paths = [schema_path, metadata_items_schema_path] + logging.info('Creating schema from XSDs at {}'.format(schema_paths)) + schema = xmlschema.XMLSchema(schema_paths) + schema.build() + if schema.validity: + logging.info('Schemas are valid') + else: + logging.error('Schemas are not valid, exiting early') + return -1 + + try: + logging.info('Validating document at {}'.format(args.dapt_in.name)) + schema.validate(args.dapt_in) + except xmlschema.XMLSchemaValidationError as valex: + logging.error(str(valex)) + logging.error('Document is not valid.') + return -1 + + logging.info( + 'Document is syntactically valid with respect to the ' + 'DAPT XML Schema Definition; ' + 'this does not check all semantic requirements of the ' + 'DAPT specification.') + return 0 + + +def main(): + parser = argparse.ArgumentParser() + + parser.add_argument( + '-dapt_in', + type=argparse.FileType('rb'), + default=sys.stdin, nargs='?', + help='Input DAPT file to validate', + action='store') + parser.set_defaults(func=validate_dapt) + + args = parser.parse_args() + return args.func(args) + + +if __name__ == "__main__": + # execute only if run as a script + sys.exit(main()) diff --git a/schema-validator/test/__init__.py b/schema-validator/test/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/schema-validator/test/fixtures/valid_dapt.ttml b/schema-validator/test/fixtures/valid_dapt.ttml new file mode 100644 index 0000000..a58ab95 --- /dev/null +++ b/schema-validator/test/fixtures/valid_dapt.ttml @@ -0,0 +1,31 @@ + + + + + + Matthias Schoenaerts + + + BOOKER + + + + + +
+ high mountain valley + +

Look at this beautiful valley.

+
+ +
\ No newline at end of file diff --git a/schema-validator/test/test_validate.py b/schema-validator/test/test_validate.py new file mode 100644 index 0000000..f20e364 --- /dev/null +++ b/schema-validator/test/test_validate.py @@ -0,0 +1,21 @@ +import os +import unittest +from argparse import Namespace +from src.validate import validate_dapt + +fixture_dur = \ + os.path.join( + os.path.dirname(__file__), + 'fixtures') + + +class testValidate(unittest.TestCase): + maxDiff = None + + def testValidFile(self): + with open( + os.path.join(fixture_dur, 'valid_dapt.ttml'), newline='') \ + as dapt_file: + result = validate_dapt(args=Namespace(dapt_in=dapt_file)) + + self.assertEqual(result, 0) diff --git a/xml-schemas/README.md b/xml-schemas/README.md new file mode 100644 index 0000000..736b1dd --- /dev/null +++ b/xml-schemas/README.md @@ -0,0 +1,47 @@ +# DAPT XSD Readme + +The [DAPT](https://www.w3.org/TR/dapt/) XML Schema is provided as an informative (i.e. non-normative) addition +to the specification as an aid to implementers. + +The XML Schema is provided as an [XSD 1](https://www.w3.org/TR/xmlschema-1/) (XML Schema definition language) document. + +## Usage + +An XSD 1 conformant XML validator should be able to validate a DAPT document against the top level [`dapt.xsd`](dapt.xsd) +schema document. + +As a convenience, a Python script is provided to allow use of the XSDs to validate +a DAPT document using only open source libraries. + +## Design + +The DAPT XSD is designed to be inclusive of all content predicted from the DAPT specification, +rather than defining attributes and elements from the DAPT specification +and relying on external XSDs for other namespace vocabulary. +This also permits DAPT-specific constraints, such as the prohibition of the `` element, +or the requirement for the `daptm:scriptRepresents` attribute on the root `` element, +can be applied. + +### Sources + +Structurally, much of the XSD consists of a copy of the [TTML2 XSD](https://github.com/w3c/ttml2/tree/main/spec/xsd), though in some cases changes have been +made to represent those additional DAPT constraints. +This means that if the TTML2 XSD changes, there could be a maintenance task to update the DAPT XSD. +However it also simplifies usage. + +Additionally, DAPT namespaces and DAPT-specific data types are defined in imported files whose name is prefixed `dapt-`. + +EBU-TT Metadata is imported via a git submodule pointed at the XSD 1 version of the +[EBU-TT Metadata schema](https://github.com/ebu/ebu-tt-m-xsd/tree/issue-0030-schema-v1). + +### Type restrictions + +Two mechanisms are used to enforce DAPT-specific type restrictions: + +1. DAPT-specific complex type definitions with `xs:complexContent` containing `xs:restriction` based on the TTML2 type. +This method is used where attributes permitted on the TTML2 type are prohibited in DAPT, and/or when additional +DAPT-specific attributes need to be permitted as extensions to the TTML2 element. +The relevant element definitions then point to the restricted DAPT type rather than the base TTML2 type. +2. Edits to remove DAPT-prohibited elements or attribute groups from TTML2 types - where this +pattern is used, XML comments highlight the change in the XSD file. + diff --git a/xml-schemas/dapt-datatypes.xsd b/xml-schemas/dapt-datatypes.xsd new file mode 100644 index 0000000..67aa1d1 --- /dev/null +++ b/xml-schemas/dapt-datatypes.xsd @@ -0,0 +1,23 @@ + + + + + + descriptor-token ( descriptor-delimiter descriptor-token )* + + descriptor-token + : (descriptorTokenChar)+ + + descriptorTokenChar # xsd:NMtoken without the "." + : NameStartChar | "-" | [0-9] | #xB7 | [#x0300-#x036F] | [#x203F-#x2040] + + descriptor-delimiter + : "." # FULL STOP U+002E + + + + + + diff --git a/xml-schemas/dapt-metadata.xsd b/xml-schemas/dapt-metadata.xsd new file mode 100644 index 0000000..09b0892 --- /dev/null +++ b/xml-schemas/dapt-metadata.xsd @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xml-schemas/dapt.xsd b/xml-schemas/dapt.xsd new file mode 100644 index 0000000..90e0fc2 --- /dev/null +++ b/xml-schemas/dapt.xsd @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xml-schemas/ebu-tt-m-xsd b/xml-schemas/ebu-tt-m-xsd new file mode 160000 index 0000000..4026249 --- /dev/null +++ b/xml-schemas/ebu-tt-m-xsd @@ -0,0 +1 @@ +Subproject commit 4026249a949f594ae0d38b84e22cf2e8e665f235 diff --git a/xml-schemas/ttml2-animation.xsd b/xml-schemas/ttml2-animation.xsd new file mode 100644 index 0000000..4619cf2 --- /dev/null +++ b/xml-schemas/ttml2-animation.xsd @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xml-schemas/ttml2-audio-attribs.xsd b/xml-schemas/ttml2-audio-attribs.xsd new file mode 100644 index 0000000..587096c --- /dev/null +++ b/xml-schemas/ttml2-audio-attribs.xsd @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + diff --git a/xml-schemas/ttml2-content.xsd b/xml-schemas/ttml2-content.xsd new file mode 100644 index 0000000..e7721a0 --- /dev/null +++ b/xml-schemas/ttml2-content.xsd @@ -0,0 +1,169 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xml-schemas/ttml2-core-attribs.xsd b/xml-schemas/ttml2-core-attribs.xsd new file mode 100644 index 0000000..bc9ab35 --- /dev/null +++ b/xml-schemas/ttml2-core-attribs.xsd @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xml-schemas/ttml2-datatypes.xsd b/xml-schemas/ttml2-datatypes.xsd new file mode 100644 index 0000000..e0cd84c --- /dev/null +++ b/xml-schemas/ttml2-datatypes.xsd @@ -0,0 +1,839 @@ + + + + + + + + + + + + + + animationValue [ ";" animationValue ]* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [ borderThickness || borderStyle || borderColor ] + + + + + + + + + + + + + + non-negative-integer non-negative-integer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + non-negative-integer + + + + + + + + + + + + + + + + + + + + length + + + + + + + + + + + + + + + + + + + + + non-negative-integer non-negative-integer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + auto | contain | cover | measure measure + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + length | length length + + + + + + + + + + + + + normal | [ super | sub ] || [ full | half ] || ruby + + + + + + + + + + + + + fragmentIdentifier + : "#" fragment + + fragment + : uric+ + + uric + : reserved + | unreserved + | escaped + + reserved + : [;/?:@&=+$,] + + unreserved + : [a-zA-Z] + | [0-9] + | [-_.!~*'()] + + escaped + : "%" hex hex + + hex + : [0-9a-fA-F] + + + + + + + non-negative-integer + + + + + + + + non-negative-integer non-negative-integer + + + + + + + + number + + + + + + + + + + + + + + + + + + + keySplines + : control [ lwsp? ";" lwsp? control ]* + + control + : x1 comma? y1 comma? x2 comma? y2 + + x1, x2, y1, y2 + : coordinate + + coordinate // 0 ≥ value ≥ 1 + : whole + | whole "." fraction + | "." fraction + + whole, fraction + : non-negative-integer + + comma + : "," + + lwsp + : ( ' ' | '\t' | '\n' | '\r' )+ + + + + + + + + keyTimes + : time [ lwsp? ";" lwsp? time ]* + + time // 0 ≥ value ≥ 1 + : whole + | whole "." fraction + | "." fraction + + whole, fraction + : non-negative-integer + + lwsp + : ( ' ' | '\t' | '\n' | '\r' )+ + + + + + + + normal | length + + + + + + normal | length + + + + + + string + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + alpha + + + + + + auto | length length + + + + + + + + + + + + length length | length length length | length length length length + + + + + + number + + + + + + + + + + pitch + : percentage + | number pitch-units? + + pitch-units + : "hz" | "st" + + + + + + + non-negative-integer non-negative-integer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + repeatCount + : count // value > 0 + | "indefinite" + + count: + : whole + | whole "." fraction + | "." fraction + + whole, fraction + : non-negative-integer + + + + + + + + + + + + + + + + + metadataRoleBaseType | "x-"string + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + percentage + + + + + + + + + + + + non-negative-integer + + + + + + + + + + + + + + + + non-negative-integer + + + + + + + + + + + + + + + + + + + + + + + + none | [ [ underline | noUnderline ] || [ lineThrough | noLineThrough ] || [ overline | noOverline ] ] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [ emphasisStyle || emphasisColor || emphasisPosition ] + + + + + + + + + + + + + none | length | length length | color length | color length length + + + + + + none | ( shadow )+ + + + + + + non-negative-integer + + + + + + + + + + + + + + + + + + + + timeExpression + + + + + + timeExpression + + + + + + + + + + + + + + + + + + + + + + + + + + + + + non-negative-integer // value > 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + auto | integer + + + + diff --git a/xml-schemas/ttml2-embedded.xsd b/xml-schemas/ttml2-embedded.xsd new file mode 100644 index 0000000..32c69fc --- /dev/null +++ b/xml-schemas/ttml2-embedded.xsd @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #PCDATA | (Metadata.class*) | (Metadata.class*, chunk+) | (Metadata.class*, source+) + The following is an over-generalization of the above content model. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xml-schemas/ttml2-head.xsd b/xml-schemas/ttml2-head.xsd new file mode 100644 index 0000000..4fd706f --- /dev/null +++ b/xml-schemas/ttml2-head.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xml-schemas/ttml2-layout.xsd b/xml-schemas/ttml2-layout.xsd new file mode 100644 index 0000000..65961b0 --- /dev/null +++ b/xml-schemas/ttml2-layout.xsd @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xml-schemas/ttml2-metadata-attribs.xsd b/xml-schemas/ttml2-metadata-attribs.xsd new file mode 100644 index 0000000..07cfe0b --- /dev/null +++ b/xml-schemas/ttml2-metadata-attribs.xsd @@ -0,0 +1,14 @@ + + + + + + + + + + diff --git a/xml-schemas/ttml2-metadata-items.xsd b/xml-schemas/ttml2-metadata-items.xsd new file mode 100644 index 0000000..7ece8fd --- /dev/null +++ b/xml-schemas/ttml2-metadata-items.xsd @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xml-schemas/ttml2-metadata.xsd b/xml-schemas/ttml2-metadata.xsd new file mode 100644 index 0000000..a1b2dec --- /dev/null +++ b/xml-schemas/ttml2-metadata.xsd @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xml-schemas/ttml2-parameter-attribs.xsd b/xml-schemas/ttml2-parameter-attribs.xsd new file mode 100644 index 0000000..f344763 --- /dev/null +++ b/xml-schemas/ttml2-parameter-attribs.xsd @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xml-schemas/ttml2-parameter-items.xsd b/xml-schemas/ttml2-parameter-items.xsd new file mode 100755 index 0000000..76e7fbf --- /dev/null +++ b/xml-schemas/ttml2-parameter-items.xsd @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xml-schemas/ttml2-parameters.xsd b/xml-schemas/ttml2-parameters.xsd new file mode 100755 index 0000000..b8e0538 --- /dev/null +++ b/xml-schemas/ttml2-parameters.xsd @@ -0,0 +1,14 @@ + + + + + + + + + + diff --git a/xml-schemas/ttml2-styling-attribs.xsd b/xml-schemas/ttml2-styling-attribs.xsd new file mode 100644 index 0000000..3feb2c1 --- /dev/null +++ b/xml-schemas/ttml2-styling-attribs.xsd @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xml-schemas/ttml2-styling.xsd b/xml-schemas/ttml2-styling.xsd new file mode 100644 index 0000000..8fb28ea --- /dev/null +++ b/xml-schemas/ttml2-styling.xsd @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xml-schemas/ttml2-timing-attribs.xsd b/xml-schemas/ttml2-timing-attribs.xsd new file mode 100644 index 0000000..cd9a34b --- /dev/null +++ b/xml-schemas/ttml2-timing-attribs.xsd @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + diff --git a/xml-schemas/xlink.xsd b/xml-schemas/xlink.xsd new file mode 100644 index 0000000..bfd01f9 --- /dev/null +++ b/xml-schemas/xlink.xsd @@ -0,0 +1,270 @@ + + + + + This schema document provides attribute declarations and + attribute group, complex type and simple type definitions which can be used in + the construction of user schemas to define the structure of particular linking + constructs, e.g. + + + + + + + ... + + ... + + + ... +]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Intended for use as the type of user-declared elements to make them + simple links. + + + + + + + + + + + + + + + + + + + + + + + + + Intended for use as the type of user-declared elements to make them + extended links. + Note that the elements referenced in the content model are all abstract. + The intention is that by simply declaring elements with these as their + substitutionGroup, all the right things will happen. + + + + + + + + + + + + + + xml:lang is not required, but provides much of the + motivation for title elements in addition to attributes, and so + is provided here for convenience. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + label is not required, but locators have no particular + XLink function if they are not labeled. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + from and to have default behavior when values are missing + + + + + + + + + + + + + + + + + diff --git a/xml-schemas/xml.xsd b/xml-schemas/xml.xsd new file mode 100644 index 0000000..f3c7201 --- /dev/null +++ b/xml-schemas/xml.xsd @@ -0,0 +1,216 @@ + + + + +
+

About the XML namespace

+
+

This schema document describes the XML namespace, in a form suitable for + import by other schema documents.

+

See + http://www.w3.org/XML/1998/namespace.html and http://www.w3.org/TR/REC-xml + for information about this namespace.

+

Note that local names in this namespace are intended to be defined only by + the World Wide Web Consortium or its subgroups. The names currently defined + in this namespace are listed below. They should not be used with conflicting + semantics by any Working Group, specification, or document instance.

+

See further below in this document for more information about how to refer to this schema document from your own XSD + schema documents and about the + namespace-versioning policy governing this schema document.

+
+
+
+
+ + + +
+

lang (as an attribute name)

+

denotes an attribute whose value is a language code for the natural language + of the content of any element; its value is inherited. This name is reserved + by virtue of its definition in the XML specification.

+
+
+

Notes

+

Attempting to install the relevant ISO 2- and 3-letter codes as the + enumerated possible values is probably never going to be a realistic + possibility.

+

See BCP 47 at + http://www.rfc-editor.org/rfc/bcp/bcp47.txt and the IANA language + subtag registry at + http://www.iana.org/assignments/language-subtag-registry for further + information.

+

The union allows for the 'un-declaration' of xml:lang with the empty string. +

+
+
+
+ + + + + + + + + +
+ + + +
+

space (as an attribute name)

+

denotes an attribute whose value is a keyword indicating what whitespace + processing discipline is intended for the content of the element; its value + is inherited. This name is reserved by virtue of its definition in the XML + specification.

+
+
+
+ + + + + + +
+ + + +
+

base (as an attribute name)

+

denotes an attribute whose value provides a URI to be used as the base for + interpreting any relative URIs in the scope of the element on which it + appears; its value is inherited. This name is reserved by virtue of its + definition in the XML Base specification.

+

See http://www.w3.org/TR/xmlbase/ for information about this attribute. +

+
+
+
+
+ + + +
+

id (as an attribute name)

+

denotes an attribute whose value should be interpreted as if declared to be + of type ID. This name is reserved by virtue of its definition in the xml:id + specification.

+

See http://www.w3.org/TR/xml-id/ + for information about this attribute.

+
+
+
+
+ + + + + + + + +
+

Father (in any context at all)

+
+

denotes Jon Bosak, the chair of the original XML Working Group. This name is + reserved by the following decision of the W3C XML Plenary and XML + Coordination groups:

+
+

In appreciation for his vision, leadership and dedication the W3C XML + Plenary on this 10th day of February, 2000, reserves for Jon Bosak in + perpetuity the XML name "xml:Father".

+
+
+
+
+
+ + +
+

+ About this schema document +

+
+

This schema defines attributes and an attribute group suitable for use by + schemas wishing to allow xml:base, xml:lang, + xml:space or xml:id attributes on elements + they define.

+

To enable this, such a schema must import this schema for the XML namespace, + e.g. as follows:

+
+          <schema . . .>
+           . . .
+           <import namespace="http://www.w3.org/XML/1998/namespace"
+                      schemaLocation="http://www.w3.org/2001/xml.xsd"/>
+     
+

or

+
+           <import namespace="http://www.w3.org/XML/1998/namespace"
+                      schemaLocation="http://www.w3.org/2009/01/xml.xsd"/>
+     
+

Subsequently, qualified reference to any of the attributes or the group + defined below will have the desired effect, e.g.

+
+          <type . . .>
+           . . .
+           <attributeGroup ref="xml:specialAttrs"/>
+     
+

will define a type which will schema-validate an instance element with any + of those attributes.

+
+
+
+
+ + +
+

+ Versioning policy for this schema document +

+
+

In keeping with the XML Schema WG's standard versioning policy, this schema + document will persist at + http://www.w3.org/2009/01/xml.xsd.

+

At the date of issue it can also be found at + http://www.w3.org/2001/xml.xsd.

+

The schema document at that URI may however change in the future, in order + to remain compatible with the latest version of XML Schema itself, or with + the XML namespace itself. In other words, if the XML Schema or XML + namespaces change, the version of this document at http://www.w3.org/2001/xml.xsd + will change accordingly; the version at + http://www.w3.org/2009/01/xml.xsd will not change.

+

Previous dated (and unchanging) versions of this schema document are at:

+ +
+
+
+
+