{"action":"created","comment":{"url":"https://api.github.com/repos/Matroska-Org/ebml-specification/pulls/comments/47054308","id":47054308,"diff_hunk":"@@ -173,21 +173,65 @@ An EBML Stream is a file that consists of one or many EBML Documents that are co\n \n ## Elements semantic\n \n-### Element Template\n+### EBML Schema\n \n-Element Name:\n+An EBML Schema is an XML Document that defines the properties, arrangement, and usage of EBML Elements that compose a specific EBML Document Type. The relationship of an EBML Schema to an EBML Document may be considered analogous to the relationship of an XML Schema to an XML Document. An EBML Schema MUST be clearly associated with one or many EBML Document Types. An EBML Schema must be expressed as well-formed XML. An EBML Document Type is identified by a unique string stored within the EBML Header element called DocType; for example `matroska` or `webm`.\n \n-    Level:\n-    EBML ID:    []\n-    Mandatory:  [Mandatory]\n-    Multiple:   [For level 0 Elements, this attribute defines whether or not the Element may be used multiple times within an EBML Document. For Elements at Level 1 or greater, this attribute defines whether or not the Element may be used multiple times within its parent Element.]\n-    Range:\n-    Default:    [Default value if the element is not found]\n-    Element Type:\n-    Description:\n+As an XML Document the EBML Schema MUST use `<table>` as the top level element. The `<table>` element may contain `<element>` sub-elements. Each `<element>` node defines one EBML Element through the use of several attributes. Each attribute of the `<element>` node of the EBML Schema is defined here along with a note to say if the attribute is mandatory or not. EBML Schemas many contain additional attributes to extend the semantics but MUST not conflict is the definitions of the `<element>` attributes defined here.\n+\n+Within the EBML Schema each EBML Element is defined to occur at a specific level. For any specificied EBML Element that is not at level 0, the Parent EBML Element refers to the EBML Master-element that that EBML Element is contained within. For any specifiied EBML Master-element the Child EBML Element refers to the EBML Elements that may be immediately contained within that Master-element. For any EBML Element that is not defined at level 0, the Parent EBML Element may be identified by the preceding `<element>` node which has a lower value as the defined `level` attribute. The only exception for this rule are Global EBML Elements which may occur within any Parent EBML Element within the restriction of the Global EBML Element's range declaration.\n+\n+#### EBML Schema Element Attributes\n+\n+Within an EBML Schema the `<element>` uses the following attributes to define an EBML Element.\n+\n+| attribute name | required | definition |\n+|----------------|----------|------------|\n+| name           | Yes      | The official human-readable name of the EBML Element. The value of the name MUST be in the form of an NCName as defined by the [XML Schema specification](http://www.w3.org/TR/1999/REC-xml-names-19990114/#ns-decl). |\n+| level          | Yes      | The level notes at what hierarchical depth the EBML Element may occur within an EBML Document. The initial EBML Element of an EBML Document is at level 0 and the Elements that it may contain are at level 1. The level MUST be expressed as an integer; however, the integer may be followed by a '+' symbol to indicate that the EBML Element is valid at any higher level.  |\n+| global         | No       | A boolean to express if an EBML Element MUST occur at its defined level or may occur within any Parent EBML Element. |\n+| id             | Yes      | The Element ID expressed in hexadecimal notation prefixed by a '0x'. |\n+| mandatory      | No       | A boolean to express if the EBML Element MUST occur if the Parent EBML Element is used. If the mandatory attribute is not expressed for that Element then that element is to be considered not mandatory. |\n+| multiple       | No       | A boolean to express if the EBML Element may occur within its Parent EBML Element more than once. If the multiple attribute is false or the  multiple attribute is not used to define the Element then that EBML Element MUST not occur more than once with that Element's Parent EBML Element. |\n+| range          | No       | For Elements which are of numerical types (Unsigned Integer, Signed Integer, Float, and Date) a numerical range may be specified. If specified that the value of the EBML Element MUST be within the defined range inclusively. See the [section of Expressions of range](#expression-of-range) for rules applied to expression of range values. |\n+| default        | No       | A default value may be provided. If an Element is mandatory but not written within its Parent EBML Element, then the reader of EBML Document MUST consider the defined default value of the Element. EBML Elements that are Master-elements MUST NOT declare a default value. |\n+| type           | Yes      | As defined within the [section on EBML Element Types](#ebml-element-types), the type MUST be set to one of the following values: 'integer' (signed integer), 'uinteger' (unsigned integer), 'float', 'string', 'date', 'utf-8', 'master', or 'binary'. |\n+\n+The value of the `<element>` shall contain a description that of the meaning and use of the EBML Element.\n+\n+#### Expression of range\n+\n+The `range` attribute MUST only be used with EBML Elements that are either `signed integer` or `unsigned integer`. The `range` attribute does not support date or float EBML Elements. The `range` expression may contain whitespace for readability but whitespace within a `range` expression MUST NOT convey meaning. The expression of the `range` MUST adhere to one of the following forms:\n+\n+    - `x-y` where x and y are integers and `y` must be greater than `x`, meaning that the value must be greater than or equal to `x` and less than or equal to `y`.\n+    - `>x` where `x` is an integer, meaning that the value MUST be greater than `x`.\n+    - `x` where `x` is an integer, meaning that the value MUST be equal `x`.\n+\n+The `range` may use the prefix `not ` to indicate that the expressed range is negated.\n+\n+#### Note on the Use of mandatory and default attributes to define EBML Elements\n+\n+If an EBML Element has a default value declared by an EBML Schema and the EBML Element's value is equal to the declared default value then that Element is not required to be present within the EBML Document if its Parent EBML Element is present. In this case, the default value of the EBML Element may be assumed although the EBML Element is not present within its Parent EBML Element.\n+\n+If an EBML Element has no default value declared by an EBML Schema and its Parent EBML Element is present than the EBML Element must be present as well. If an EBML Element has a default value declared by an EBML Schema and its Parent EBML Element is present and the EBML Element's value is NOT equal to the declared default value then the EBML Element MUST be used.","path":"specification.markdown","position":null,"original_position":54,"commit_id":"2606dc5ac432c02d837c4df18bb94cdb08593f59","original_commit_id":"3d9d0f45f0fec516be7b7261d84c74d6152d350e","user":{"login":"dericed","id":762604,"avatar_url":"https://avatars.githubusercontent.com/u/762604?v=3","gravatar_id":"","url":"https://api.github.com/users/dericed","html_url":"https://github.com/dericed","followers_url":"https://api.github.com/users/dericed/followers","following_url":"https://api.github.com/users/dericed/following{/other_user}","gists_url":"https://api.github.com/users/dericed/gists{/gist_id}","starred_url":"https://api.github.com/users/dericed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dericed/subscriptions","organizations_url":"https://api.github.com/users/dericed/orgs","repos_url":"https://api.github.com/users/dericed/repos","events_url":"https://api.github.com/users/dericed/events{/privacy}","received_events_url":"https://api.github.com/users/dericed/received_events","type":"User","site_admin":false},"body":"You're right, this wasn't clear enough. I updated the section to be more clear that it is discussing Mandatory EBML Elements here https://github.com/MediaArea/ebml-specification/commit/2606dc5ac432c02d837c4df18bb94cdb08593f59.","created_at":"2015-12-09T06:09:20Z","updated_at":"2015-12-09T06:09:20Z","html_url":"https://github.com/Matroska-Org/ebml-specification/pull/40#discussion_r47054308","pull_request_url":"https://api.github.com/repos/Matroska-Org/ebml-specification/pulls/40","_links":{"self":{"href":"https://api.github.com/repos/Matroska-Org/ebml-specification/pulls/comments/47054308"},"html":{"href":"https://github.com/Matroska-Org/ebml-specification/pull/40#discussion_r47054308"},"pull_request":{"href":"https://api.github.com/repos/Matroska-Org/ebml-specification/pulls/40"}}},"pull_request":{"url":"https://api.github.com/repos/Matroska-Org/ebml-specification/pulls/40","id":52748833,"html_url":"https://github.com/Matroska-Org/ebml-specification/pull/40","diff_url":"https://github.com/Matroska-Org/ebml-specification/pull/40.diff","patch_url":"https://github.com/Matroska-Org/ebml-specification/pull/40.patch","issue_url":"https://api.github.com/repos/Matroska-Org/ebml-specification/issues/40","number":40,"state":"open","locked":false,"title":"Ebml schema","user":{"login":"dericed","id":762604,"avatar_url":"https://avatars.githubusercontent.com/u/762604?v=3","gravatar_id":"","url":"https://api.github.com/users/dericed","html_url":"https://github.com/dericed","followers_url":"https://api.github.com/users/dericed/followers","following_url":"https://api.github.com/users/dericed/following{/other_user}","gists_url":"https://api.github.com/users/dericed/gists{/gist_id}","starred_url":"https://api.github.com/users/dericed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dericed/subscriptions","organizations_url":"https://api.github.com/users/dericed/orgs","repos_url":"https://api.github.com/users/dericed/repos","events_url":"https://api.github.com/users/dericed/events{/privacy}","received_events_url":"https://api.github.com/users/dericed/received_events","type":"User","site_admin":false},"body":"This PR touches on many conversations within matroska-devel, github, and (soon) cellar. Please review the section on mandatory/default carefully.\n\nAlso note that the EBML Schema section currently defined the current instance of the Matroska which is a machine-readable XML definition of the Matroska EBML DocType as seen here https://github.com/Matroska-Org/foundation-source/blob/3414f292bb5b1ac5ee2fd99976b7274fd81e48ee/spectool/specdata.xml. I hope to advance specdata.xml more closely to practices used in XML Schemas, but syncing the existing documentation with the existing specdata.xml seems like a good place to start.","created_at":"2015-12-05T06:48:10Z","updated_at":"2015-12-09T06:09:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"336c8613056954c1391a09751d6689d48dcc4a45","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Matroska-Org/ebml-specification/pulls/40/commits","review_comments_url":"https://api.github.com/repos/Matroska-Org/ebml-specification/pulls/40/comments","review_comment_url":"https://api.github.com/repos/Matroska-Org/ebml-specification/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Matroska-Org/ebml-specification/issues/40/comments","statuses_url":"https://api.github.com/repos/Matroska-Org/ebml-specification/statuses/2606dc5ac432c02d837c4df18bb94cdb08593f59","head":{"label":"MediaArea:ebml-schema","ref":"ebml-schema","sha":"2606dc5ac432c02d837c4df18bb94cdb08593f59","user":{"login":"MediaArea","id":7846736,"avatar_url":"https://avatars.githubusercontent.com/u/7846736?v=3","gravatar_id":"","url":"https://api.github.com/users/MediaArea","html_url":"https://github.com/MediaArea","followers_url":"https://api.github.com/users/MediaArea/followers","following_url":"https://api.github.com/users/MediaArea/following{/other_user}","gists_url":"https://api.github.com/users/MediaArea/gists{/gist_id}","starred_url":"https://api.github.com/users/MediaArea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MediaArea/subscriptions","organizations_url":"https://api.github.com/users/MediaArea/orgs","repos_url":"https://api.github.com/users/MediaArea/repos","events_url":"https://api.github.com/users/MediaArea/events{/privacy}","received_events_url":"https://api.github.com/users/MediaArea/received_events","type":"Organization","site_admin":false},"repo":{"id":34998353,"name":"ebml-specification","full_name":"MediaArea/ebml-specification","owner":{"login":"MediaArea","id":7846736,"avatar_url":"https://avatars.githubusercontent.com/u/7846736?v=3","gravatar_id":"","url":"https://api.github.com/users/MediaArea","html_url":"https://github.com/MediaArea","followers_url":"https://api.github.com/users/MediaArea/followers","following_url":"https://api.github.com/users/MediaArea/following{/other_user}","gists_url":"https://api.github.com/users/MediaArea/gists{/gist_id}","starred_url":"https://api.github.com/users/MediaArea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MediaArea/subscriptions","organizations_url":"https://api.github.com/users/MediaArea/orgs","repos_url":"https://api.github.com/users/MediaArea/repos","events_url":"https://api.github.com/users/MediaArea/events{/privacy}","received_events_url":"https://api.github.com/users/MediaArea/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/MediaArea/ebml-specification","description":"the specification for the EBML format","fork":true,"url":"https://api.github.com/repos/MediaArea/ebml-specification","forks_url":"https://api.github.com/repos/MediaArea/ebml-specification/forks","keys_url":"https://api.github.com/repos/MediaArea/ebml-specification/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MediaArea/ebml-specification/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MediaArea/ebml-specification/teams","hooks_url":"https://api.github.com/repos/MediaArea/ebml-specification/hooks","issue_events_url":"https://api.github.com/repos/MediaArea/ebml-specification/issues/events{/number}","events_url":"https://api.github.com/repos/MediaArea/ebml-specification/events","assignees_url":"https://api.github.com/repos/MediaArea/ebml-specification/assignees{/user}","branches_url":"https://api.github.com/repos/MediaArea/ebml-specification/branches{/branch}","tags_url":"https://api.github.com/repos/MediaArea/ebml-specification/tags","blobs_url":"https://api.github.com/repos/MediaArea/ebml-specification/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MediaArea/ebml-specification/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MediaArea/ebml-specification/git/refs{/sha}","trees_url":"https://api.github.com/repos/MediaArea/ebml-specification/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MediaArea/ebml-specification/statuses/{sha}","languages_url":"https://api.github.com/repos/MediaArea/ebml-specification/languages","stargazers_url":"https://api.github.com/repos/MediaArea/ebml-specification/stargazers","contributors_url":"https://api.github.com/repos/MediaArea/ebml-specification/contributors","subscribers_url":"https://api.github.com/repos/MediaArea/ebml-specification/subscribers","subscription_url":"https://api.github.com/repos/MediaArea/ebml-specification/subscription","commits_url":"https://api.github.com/repos/MediaArea/ebml-specification/commits{/sha}","git_commits_url":"https://api.github.com/repos/MediaArea/ebml-specification/git/commits{/sha}","comments_url":"https://api.github.com/repos/MediaArea/ebml-specification/comments{/number}","issue_comment_url":"https://api.github.com/repos/MediaArea/ebml-specification/issues/comments{/number}","contents_url":"https://api.github.com/repos/MediaArea/ebml-specification/contents/{+path}","compare_url":"https://api.github.com/repos/MediaArea/ebml-specification/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MediaArea/ebml-specification/merges","archive_url":"https://api.github.com/repos/MediaArea/ebml-specification/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MediaArea/ebml-specification/downloads","issues_url":"https://api.github.com/repos/MediaArea/ebml-specification/issues{/number}","pulls_url":"https://api.github.com/repos/MediaArea/ebml-specification/pulls{/number}","milestones_url":"https://api.github.com/repos/MediaArea/ebml-specification/milestones{/number}","notifications_url":"https://api.github.com/repos/MediaArea/ebml-specification/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MediaArea/ebml-specification/labels{/name}","releases_url":"https://api.github.com/repos/MediaArea/ebml-specification/releases{/id}","created_at":"2015-05-03T19:43:13Z","updated_at":"2015-05-03T17:48:36Z","pushed_at":"2015-12-09T06:08:18Z","git_url":"git://github.com/MediaArea/ebml-specification.git","ssh_url":"git@github.com:MediaArea/ebml-specification.git","clone_url":"https://github.com/MediaArea/ebml-specification.git","svn_url":"https://github.com/MediaArea/ebml-specification","homepage":null,"size":125,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Matroska-Org:master","ref":"master","sha":"5592c22d687bbb2f1366032ab4411e4c6c44ccd5","user":{"login":"Matroska-Org","id":3148284,"avatar_url":"https://avatars.githubusercontent.com/u/3148284?v=3","gravatar_id":"","url":"https://api.github.com/users/Matroska-Org","html_url":"https://github.com/Matroska-Org","followers_url":"https://api.github.com/users/Matroska-Org/followers","following_url":"https://api.github.com/users/Matroska-Org/following{/other_user}","gists_url":"https://api.github.com/users/Matroska-Org/gists{/gist_id}","starred_url":"https://api.github.com/users/Matroska-Org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Matroska-Org/subscriptions","organizations_url":"https://api.github.com/users/Matroska-Org/orgs","repos_url":"https://api.github.com/users/Matroska-Org/repos","events_url":"https://api.github.com/users/Matroska-Org/events{/privacy}","received_events_url":"https://api.github.com/users/Matroska-Org/received_events","type":"Organization","site_admin":false},"repo":{"id":34994967,"name":"ebml-specification","full_name":"Matroska-Org/ebml-specification","owner":{"login":"Matroska-Org","id":3148284,"avatar_url":"https://avatars.githubusercontent.com/u/3148284?v=3","gravatar_id":"","url":"https://api.github.com/users/Matroska-Org","html_url":"https://github.com/Matroska-Org","followers_url":"https://api.github.com/users/Matroska-Org/followers","following_url":"https://api.github.com/users/Matroska-Org/following{/other_user}","gists_url":"https://api.github.com/users/Matroska-Org/gists{/gist_id}","starred_url":"https://api.github.com/users/Matroska-Org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Matroska-Org/subscriptions","organizations_url":"https://api.github.com/users/Matroska-Org/orgs","repos_url":"https://api.github.com/users/Matroska-Org/repos","events_url":"https://api.github.com/users/Matroska-Org/events{/privacy}","received_events_url":"https://api.github.com/users/Matroska-Org/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Matroska-Org/ebml-specification","description":"the specification for the EBML format","fork":false,"url":"https://api.github.com/repos/Matroska-Org/ebml-specification","forks_url":"https://api.github.com/repos/Matroska-Org/ebml-specification/forks","keys_url":"https://api.github.com/repos/Matroska-Org/ebml-specification/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Matroska-Org/ebml-specification/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Matroska-Org/ebml-specification/teams","hooks_url":"https://api.github.com/repos/Matroska-Org/ebml-specification/hooks","issue_events_url":"https://api.github.com/repos/Matroska-Org/ebml-specification/issues/events{/number}","events_url":"https://api.github.com/repos/Matroska-Org/ebml-specification/events","assignees_url":"https://api.github.com/repos/Matroska-Org/ebml-specification/assignees{/user}","branches_url":"https://api.github.com/repos/Matroska-Org/ebml-specification/branches{/branch}","tags_url":"https://api.github.com/repos/Matroska-Org/ebml-specification/tags","blobs_url":"https://api.github.com/repos/Matroska-Org/ebml-specification/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Matroska-Org/ebml-specification/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Matroska-Org/ebml-specification/git/refs{/sha}","trees_url":"https://api.github.com/repos/Matroska-Org/ebml-specification/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Matroska-Org/ebml-specification/statuses/{sha}","languages_url":"https://api.github.com/repos/Matroska-Org/ebml-specification/languages","stargazers_url":"https://api.github.com/repos/Matroska-Org/ebml-specification/stargazers","contributors_url":"https://api.github.com/repos/Matroska-Org/ebml-specification/contributors","subscribers_url":"https://api.github.com/repos/Matroska-Org/ebml-specification/subscribers","subscription_url":"https://api.github.com/repos/Matroska-Org/ebml-specification/subscription","commits_url":"https://api.github.com/repos/Matroska-Org/ebml-specification/commits{/sha}","git_commits_url":"https://api.github.com/repos/Matroska-Org/ebml-specification/git/commits{/sha}","comments_url":"https://api.github.com/repos/Matroska-Org/ebml-specification/comments{/number}","issue_comment_url":"https://api.github.com/repos/Matroska-Org/ebml-specification/issues/comments{/number}","contents_url":"https://api.github.com/repos/Matroska-Org/ebml-specification/contents/{+path}","compare_url":"https://api.github.com/repos/Matroska-Org/ebml-specification/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Matroska-Org/ebml-specification/merges","archive_url":"https://api.github.com/repos/Matroska-Org/ebml-specification/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Matroska-Org/ebml-specification/downloads","issues_url":"https://api.github.com/repos/Matroska-Org/ebml-specification/issues{/number}","pulls_url":"https://api.github.com/repos/Matroska-Org/ebml-specification/pulls{/number}","milestones_url":"https://api.github.com/repos/Matroska-Org/ebml-specification/milestones{/number}","notifications_url":"https://api.github.com/repos/Matroska-Org/ebml-specification/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Matroska-Org/ebml-specification/labels{/name}","releases_url":"https://api.github.com/repos/Matroska-Org/ebml-specification/releases{/id}","created_at":"2015-05-03T17:48:36Z","updated_at":"2015-12-03T09:31:36Z","pushed_at":"2015-12-09T06:08:18Z","git_url":"git://github.com/Matroska-Org/ebml-specification.git","ssh_url":"git@github.com:Matroska-Org/ebml-specification.git","clone_url":"https://github.com/Matroska-Org/ebml-specification.git","svn_url":"https://github.com/Matroska-Org/ebml-specification","homepage":null,"size":436,"stargazers_count":5,"watchers_count":5,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":9,"forks":3,"open_issues":9,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Matroska-Org/ebml-specification/pulls/40"},"html":{"href":"https://github.com/Matroska-Org/ebml-specification/pull/40"},"issue":{"href":"https://api.github.com/repos/Matroska-Org/ebml-specification/issues/40"},"comments":{"href":"https://api.github.com/repos/Matroska-Org/ebml-specification/issues/40/comments"},"review_comments":{"href":"https://api.github.com/repos/Matroska-Org/ebml-specification/pulls/40/comments"},"review_comment":{"href":"https://api.github.com/repos/Matroska-Org/ebml-specification/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Matroska-Org/ebml-specification/pulls/40/commits"},"statuses":{"href":"https://api.github.com/repos/Matroska-Org/ebml-specification/statuses/2606dc5ac432c02d837c4df18bb94cdb08593f59"}}}}