nora_mark 0.2beta3 → 0.2beta4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +5 -0
  3. data/Gemfile +2 -0
  4. data/README.md +17 -12
  5. data/example/nora-simple.css +52 -0
  6. data/example/noramark-reference-ja.nora +246 -0
  7. data/example/noramark-reference-ja_00001.xhtml +187 -0
  8. data/lib/nora_mark/html/{abstract_item_writer.rb → abstract_node_writer.rb} +3 -3
  9. data/lib/nora_mark/html/context.rb +3 -21
  10. data/lib/nora_mark/html/frontmatter_writer.rb +33 -0
  11. data/lib/nora_mark/html/generator.rb +122 -100
  12. data/lib/nora_mark/html/pages.rb +3 -9
  13. data/lib/nora_mark/html/paragraph_writer.rb +27 -23
  14. data/lib/nora_mark/html/tag_writer.rb +33 -34
  15. data/lib/nora_mark/html/writer_selector.rb +3 -3
  16. data/lib/nora_mark/node.rb +31 -0
  17. data/lib/nora_mark/parser.kpeg +133 -79
  18. data/lib/nora_mark/parser.kpeg.rb +1822 -1526
  19. data/lib/nora_mark/parser.rb +4 -23
  20. data/lib/nora_mark/version.rb +1 -1
  21. data/lib/nora_mark.rb +7 -2
  22. data/nora_mark.gemspec +1 -0
  23. data/spec/epub30-schemas/epub-nav-30.nvdl +16 -0
  24. data/spec/epub30-schemas/epub-nav-30.rnc +10 -0
  25. data/spec/epub30-schemas/epub-nav-30.sch +72 -0
  26. data/spec/epub30-schemas/epub-svg-30.nvdl +15 -0
  27. data/spec/epub30-schemas/epub-svg-30.rnc +15 -0
  28. data/spec/epub30-schemas/epub-svg-30.sch +10 -0
  29. data/spec/epub30-schemas/epub-xhtml-30.nvdl +15 -0
  30. data/spec/epub30-schemas/epub-xhtml-30.rnc +37 -0
  31. data/spec/epub30-schemas/epub-xhtml-30.sch +377 -0
  32. data/spec/epub30-schemas/epub30-catalog.xml +335 -0
  33. data/spec/epub30-schemas/media-overlay-30.nvdl +14 -0
  34. data/spec/epub30-schemas/media-overlay-30.rnc +46 -0
  35. data/spec/epub30-schemas/media-overlay-30.sch +9 -0
  36. data/spec/epub30-schemas/mod/datatypes.rnc +143 -0
  37. data/spec/epub30-schemas/mod/epub-mathml3-30.rnc +74 -0
  38. data/spec/epub30-schemas/mod/epub-prefix-attr.rnc +8 -0
  39. data/spec/epub30-schemas/mod/epub-ssml-attrs.rnc +11 -0
  40. data/spec/epub30-schemas/mod/epub-svg11-30.rnc +12 -0
  41. data/spec/epub30-schemas/mod/epub-svg11-re.sch +7 -0
  42. data/spec/epub30-schemas/mod/epub-switch.rnc +32 -0
  43. data/spec/epub30-schemas/mod/epub-trigger.rnc +17 -0
  44. data/spec/epub30-schemas/mod/epub-type-attr.rnc +7 -0
  45. data/spec/epub30-schemas/mod/epub-xhtml-mathml3-30.rnc +5 -0
  46. data/spec/epub30-schemas/mod/epub-xhtml-svg11-30.rnc +6 -0
  47. data/spec/epub30-schemas/mod/html5/LICENSE +23 -0
  48. data/spec/epub30-schemas/mod/html5/README +21 -0
  49. data/spec/epub30-schemas/mod/html5/html5-aria-30.rnc +105 -0
  50. data/spec/epub30-schemas/mod/html5/html5-attrib-30.rnc +44 -0
  51. data/spec/epub30-schemas/mod/html5/html5-document-30.rnc +44 -0
  52. data/spec/epub30-schemas/mod/html5/html5-edit-30.rnc +24 -0
  53. data/spec/epub30-schemas/mod/html5/html5-embed-30.rnc +155 -0
  54. data/spec/epub30-schemas/mod/html5/html5-forms-30.rnc +431 -0
  55. data/spec/epub30-schemas/mod/html5/html5-grouping-30.rnc +115 -0
  56. data/spec/epub30-schemas/mod/html5/html5-interactive-30.rnc +86 -0
  57. data/spec/epub30-schemas/mod/html5/html5-models-30.rnc +10 -0
  58. data/spec/epub30-schemas/mod/html5/html5-phrasing-30.rnc +134 -0
  59. data/spec/epub30-schemas/mod/html5/html5-script-30.rnc +164 -0
  60. data/spec/epub30-schemas/mod/html5/html5-sections-30.rnc +58 -0
  61. data/spec/epub30-schemas/mod/html5/html5-style-30.rnc +18 -0
  62. data/spec/epub30-schemas/mod/id-unique.sch +10 -0
  63. data/spec/epub30-schemas/mod/mathml/LICENSE +3 -0
  64. data/spec/epub30-schemas/mod/mathml/mathml3-common.rnc +84 -0
  65. data/spec/epub30-schemas/mod/mathml/mathml3-content.rnc +373 -0
  66. data/spec/epub30-schemas/mod/mathml/mathml3-presentation.rnc +536 -0
  67. data/spec/epub30-schemas/mod/mathml/mathml3-strict-content.rnc +60 -0
  68. data/spec/epub30-schemas/mod/security/LICENSE +4 -0
  69. data/spec/epub30-schemas/mod/security/Lenient-Encryption11-ghc.rnc +41 -0
  70. data/spec/epub30-schemas/mod/security/Lenient-Encryption11.rnc +39 -0
  71. data/spec/epub30-schemas/mod/security/Lenient-Signature-exclusiveC14N.rnc +25 -0
  72. data/spec/epub30-schemas/mod/security/Lenient-Signature11-properties-exclusiveC14N.rnc +32 -0
  73. data/spec/epub30-schemas/mod/security/Lenient-Signature11-properties.rnc +30 -0
  74. data/spec/epub30-schemas/mod/security/Lenient-Signature11.rnc +28 -0
  75. data/spec/epub30-schemas/mod/security/Strict-Encryption.rnc +27 -0
  76. data/spec/epub30-schemas/mod/security/Strict-Signature.rnc +22 -0
  77. data/spec/epub30-schemas/mod/security/exc-c14n.rnc +39 -0
  78. data/spec/epub30-schemas/mod/security/security_any.rnc +15 -0
  79. data/spec/epub30-schemas/mod/security/xenc-allowAnyForeign.rnc +25 -0
  80. data/spec/epub30-schemas/mod/security/xenc-schema-11.rnc +96 -0
  81. data/spec/epub30-schemas/mod/security/xenc-schema.rnc +145 -0
  82. data/spec/epub30-schemas/mod/security/xenc11-allowAnyForeign.rnc +19 -0
  83. data/spec/epub30-schemas/mod/security/xmldsig-allowAnyForeign.rnc +47 -0
  84. data/spec/epub30-schemas/mod/security/xmldsig-core-schema.rnc +276 -0
  85. data/spec/epub30-schemas/mod/security/xmldsig-filter2.rnc +16 -0
  86. data/spec/epub30-schemas/mod/security/xmldsig-properties-schema.rnc +34 -0
  87. data/spec/epub30-schemas/mod/security/xmldsig11-allowAnyForeign.rnc +18 -0
  88. data/spec/epub30-schemas/mod/security/xmldsig11-schema.rnc +133 -0
  89. data/spec/epub30-schemas/mod/security/xmlsec-ghc-allowAnyForeign.rnc +21 -0
  90. data/spec/epub30-schemas/mod/security/xmlsec-ghc-schema.rnc +42 -0
  91. data/spec/epub30-schemas/mod/svg11/LICENSE +1 -0
  92. data/spec/epub30-schemas/mod/svg11/README.txt +8 -0
  93. data/spec/epub30-schemas/mod/svg11/svg11-flat.rnc +3999 -0
  94. data/spec/epub30-schemas/ocf-container-30.rnc +16 -0
  95. data/spec/epub30-schemas/ocf-encryption-30.rnc +12 -0
  96. data/spec/epub30-schemas/ocf-signatures-30.rnc +8 -0
  97. data/spec/epub30-schemas/package-30.nvdl +14 -0
  98. data/spec/epub30-schemas/package-30.rnc +91 -0
  99. data/spec/epub30-schemas/package-30.sch +137 -0
  100. data/spec/jing-20091111/bin/jing.jar +0 -0
  101. data/spec/nora_mark_spec.rb +229 -68
  102. data/spec/spec_helper.rb +16 -0
  103. metadata +179 -6
  104. data/lib/nora_mark/html/header_writer.rb +0 -35
  105. data/spec/fixture/test_src_ja.nora +0 -50
@@ -0,0 +1,11 @@
1
+
2
+
3
+ namespace ssml = "http://www.w3.org/2001/10/synthesis"
4
+
5
+
6
+ html5.global.attrs &= epub.ssml.ph.attr? & epub.ssml.alphabet.attr?
7
+
8
+ #TODO determine injection in SVG
9
+
10
+ epub.ssml.ph.attr = attribute ssml:ph { datatype.ssml.PhoneticExpression }
11
+ epub.ssml.alphabet.attr = attribute ssml:alphabet { datatype.ssml.PhoneticAlphabet }
@@ -0,0 +1,12 @@
1
+ # $Id: epub-svg11-30.rnc 3093 2011-08-22 18:33:36Z markus.gylling@gmail.com $
2
+ # Contributors: MURATA Makoto and Markus Gylling
3
+
4
+ include "svg11/svg11-flat.rnc" {
5
+ start = svg
6
+ SVG.id.attrib = attribute id { parent datatype.ID }?
7
+ SVG.AnimationEvents.attrib = notAllowed
8
+ SVG.Animation.class = notAllowed
9
+ SVG.foreignObject.extra.content = parent html5.flow.class
10
+ SVG.title.extra.content = parent html5.phrasing.class
11
+ }
12
+
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <pattern id="svg-fo-re" xmlns="http://purl.oclc.org/dsdl/schematron">
3
+ <rule context="svg:foreignObject[@requiredExtensions]">
4
+ <assert test="@requiredExtensions = 'http://www.idpf.org/2007/ops'"
5
+ >Invalid value (expecting: 'http://www.idpf.org/2007/ops')</assert>
6
+ </rule>
7
+ </pattern>
@@ -0,0 +1,32 @@
1
+
2
+ namespace epub = "http://www.idpf.org/2007/ops"
3
+
4
+ html5.flow.class |= epub.switch.flow
5
+ html5.phrasing.class |= epub.switch.phrasing
6
+
7
+ epub.switch.flow = element epub:switch { epub.switch.attlist, epub.switch.case.flow+, epub.switch.default.flow }
8
+ epub.switch.phrasing = element epub:switch { epub.switch.attlist, epub.switch.case.phrasing+, epub.switch.default.phrasing }
9
+
10
+ epub.switch.case.flow = element epub:case { epub.case.attlist & epub.case.flow.content }
11
+ epub.switch.case.phrasing = element epub:case { epub.case.attlist & epub.case.phrasing.content }
12
+ epub.switch.default.flow = element epub:default { epub.default.attlist & epub.default.flow.content }
13
+ epub.switch.default.phrasing = element epub:default { epub.default.attlist & epub.default.phrasing.content }
14
+
15
+ epub.case.flow.content = epub.switch.any
16
+ epub.case.phrasing.content = epub.switch.any
17
+ epub.switch.any = (anyElement | text)*
18
+
19
+ epub.default.flow.content = html5.flow.model
20
+ epub.default.phrasing.content = html5.phrasing.model
21
+
22
+ epub.switch.attlist &= html5.id.attr?
23
+ epub.case.attlist &= html5.id.attr? & epub.case.rn.attr
24
+ epub.default.attlist &= html5.id.attr?
25
+
26
+ epub.case.rn.attr = attribute required-namespace { datatype.URI }
27
+
28
+ anyElement = element * {
29
+ (attribute * { text }
30
+ | text
31
+ | anyElement)*
32
+ }
@@ -0,0 +1,17 @@
1
+
2
+ namespace epub = "http://www.idpf.org/2007/ops"
3
+ namespace ev = "http://www.w3.org/2001/xml-events"
4
+
5
+ html5.metadata.class |= epub.trigger
6
+ html5.flow.class |= epub.trigger
7
+
8
+
9
+ epub.trigger = element epub:trigger { epub.trigger.attlist & epub.trigger.content }
10
+ epub.trigger.attlist = html5.id.attr? & epub.trigger.action.attr & epub.trigger.ref.attr & xml.events.event.attr & xml.events.observer.attr
11
+
12
+ epub.trigger.action.attr = attribute action { 'show'|'hide'|'play'|'pause'|'resume'|'mute'|'unmute' }
13
+ epub.trigger.ref.attr = attribute ref { datatype.IDREF }
14
+ xml.events.event.attr = attribute ev:event { datatype.NMTOKEN }
15
+ xml.events.observer.attr = attribute ev:observer { datatype.IDREF }
16
+
17
+ epub.trigger.content = empty
@@ -0,0 +1,7 @@
1
+
2
+
3
+ namespace epub = "http://www.idpf.org/2007/ops"
4
+
5
+ html5.global.attrs &= epub.type.attr?
6
+
7
+ epub.type.attr = attribute epub:type { datatype.properties }
@@ -0,0 +1,5 @@
1
+
2
+
3
+ html5.phrasing.class |= math
4
+ html5.flow.class |= math
5
+ math = external "epub-mathml3-30.rnc"
@@ -0,0 +1,6 @@
1
+ # $Id: epub-xhtml-svg11-30.rnc 3024 2011-07-10 08:29:17Z eb2mmrt $
2
+ # Contributors: MURATA Makoto and Markus Gylling
3
+
4
+ html5.phrasing.class |= svg
5
+ html5.flow.class |= svg
6
+ svg = external "epub-svg11-30.rnc"
@@ -0,0 +1,23 @@
1
+ The license statement herein applies to all files in this directory.
2
+
3
+ Copyright (c) 2005-2007 Elika J. Etemad (fantasai) and Henri Sivonen (hsivonen)
4
+ Copyright (c) 2007-2008 Mozilla Foundation
5
+ Copyright (c) 2010-2011 International Digital Publishing Forum
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
8
+ this software and associated documentation files (the "Software"), to deal in
9
+ the Software without restriction, including without limitation the rights to
10
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
11
+ of the Software, and to permit persons to whom the Software is furnished to do
12
+ so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in all
15
+ copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ THE SOFTWARE.
@@ -0,0 +1,21 @@
1
+
2
+ The modules in this directory are part of the schema that defines
3
+ a vocabulary and grammar for EPUB3 XHTML Content Documents [1],
4
+ based on W3C XHTML5 [2], with IDPF/EPUB extensions.
5
+
6
+ The modules are derived from the schemas used in the validator.nu
7
+ service [3].
8
+
9
+ The schema for for EPUB3 XHTML Content Documents is not continuously
10
+ updated to reflect the latest version of the W3C HTML5 specification;
11
+ it is a static representation of the EPUB3 XHTML Content Document
12
+ definition, and changes to it occur only in conjunction with new
13
+ releases of the EPUB3 specification.
14
+
15
+ Note - as the W3C HTML5 specification becomes a Final Recommendation,
16
+ it is anticipated that IDPF will no longer maintain its own complete
17
+ schema.
18
+
19
+ [1] http://idpf.org/epub/30/spec/epub30-contentdocs.html#sec-xhtml
20
+ [2] http://www.w3.org/TR/html5/
21
+ [3] https://bitbucket.org/validator/syntax/
@@ -0,0 +1,105 @@
1
+
2
+
3
+ html5.global.attrs &= aria
4
+
5
+ aria = aria.role.attr? & aria.global & aria.widget.excl & aria.relationship.excl
6
+
7
+ aria.role.attr = attribute role { datatype.NMTOKENS }
8
+
9
+
10
+ # Global States and Properties
11
+ # http://www.w3.org/WAI/PF/aria/states_and_properties#global_states
12
+ aria.global = aria.prop.atomic? & aria.state.busy? & aria.prop.controls?
13
+ & aria.prop.describedby? & aria.state.disabled? & aria.prop.dropeffect?
14
+ & aria.prop.flowto? & aria.state.grabbed? & aria.prop.haspopup?
15
+ & aria.state.hidden? & aria.state.invalid? & aria.prop.label?
16
+ & aria.prop.labelledby? & aria.prop.live? & aria.prop.owns?
17
+ & aria.prop.relevant?
18
+
19
+ # exclusive widget, not in global
20
+ # http://www.w3.org/WAI/PF/aria/states_and_properties#attrs_widgets
21
+ aria.widget.excl = aria.prop.autocomplete? & aria.state.checked?
22
+ & aria.state.expanded? & aria.prop.level? & aria.prop.multiline?
23
+ & aria.prop.multiselectable? & aria.prop.orientation? & aria.state.pressed?
24
+ & aria.prop.readonly? & aria.prop.required? & aria.state.selected?
25
+ & aria.prop.sort? & aria.prop.valuemax? & aria.prop.valuemin?
26
+ & aria.prop.valuenow? & aria.prop.valuetext?
27
+
28
+ # exclusive relationship, not in global
29
+ # http://www.w3.org/WAI/PF/aria/states_and_properties#attrs_relationships
30
+ aria.relationship.excl = aria.prop.activedescendant? & aria.prop.posinset?
31
+ & aria.prop.setsize?
32
+
33
+
34
+ aria.state.busy = attribute aria-busy { 'true' | 'false' }
35
+ aria.state.checked = attribute aria-checked { 'true' | 'false' | 'mixed' | 'undefined' }
36
+ aria.state.disabled = attribute aria-disabled { 'true' | 'false' }
37
+ aria.state.expanded = attribute aria-expanded { 'true' | 'false' | 'undefined' }
38
+ aria.state.grabbed = attribute aria-grabbed { 'true' | 'false' | 'undefined' }
39
+ aria.state.hidden = attribute aria-hidden { 'true' | 'false' }
40
+ aria.state.invalid = attribute aria-invalid { 'true' | 'false' | 'grammar' | 'spelling' }
41
+ aria.state.pressed = attribute aria-pressed { 'true' | 'false' | 'mixed' | "undefined" }
42
+ aria.state.selected = attribute aria-selected { 'true' | 'false' | 'undefined' }
43
+
44
+ aria.prop.activedescendant = attribute aria-activedescendant { datatype.IDREF }
45
+ aria.prop.atomic = attribute aria-atomic { 'true' | 'false' }
46
+ aria.prop.autocomplete = attribute aria-autocomplete { 'inline' | 'list' | 'both' | 'none' }
47
+ aria.prop.controls = attribute aria-controls { datatype.IDREFS }
48
+ aria.prop.describedby = attribute aria-describedby { datatype.IDREFS }
49
+ aria.prop.dropeffect = attribute aria-dropeffect
50
+ { token 'none' | token "popup" | token "execute"
51
+ | list {('copy'), ('execute')? } | list { ('move'), ('execute')?}
52
+ | list { ('reference'), ('execute')? } | list { ('execute') , ('copy') }
53
+ | list { ('execute') , ('move')} | list { ('execute' ), ('reference') }
54
+ }
55
+ aria.prop.flowto = attribute aria-flowto { datatype.IDREFS }
56
+ aria.prop.haspopup = attribute aria-haspopup { 'true' | 'false' }
57
+ aria.prop.label = attribute aria-label { datatype.string }
58
+ aria.prop.labelledby = attribute aria-labelledby { datatype.IDREFS }
59
+ aria.prop.level = attribute aria-level { datatype.positive.integer }
60
+ aria.prop.live = attribute aria-live { 'off' | 'polite' | 'assertive' }
61
+ aria.prop.multiline = attribute aria-multiline { 'true' | 'false' }
62
+ aria.prop.multiselectable = attribute aria-multiselectable { 'true' | 'false' }
63
+ aria.prop.orientation = attribute aria-orientation { 'vertical' | 'horizontal' }
64
+ aria.prop.owns = attribute aria-owns { datatype.IDREFS }
65
+ aria.prop.posinset = attribute aria-posinset { datatype.positive.integer }
66
+ aria.prop.readonly = attribute aria-readonly { 'true' | 'false' }
67
+ aria.prop.relevant = attribute aria-relevant
68
+ { token "all"
69
+ | list { ( 'additions' ), ( 'removals' )? , ( 'text' )? }
70
+ | list { ( 'additions' ), ( 'text' )?, ( 'removals' )? }
71
+ | list { ( 'removals' ), ( 'additions' )?, ( 'text' )? }
72
+ | list { ( 'removals' ), ( 'text' )?, ( 'additions' )? }
73
+ | list { ( 'text' ), ( 'additions' )?, ( 'removals' )? }
74
+ | list { ( 'text' ), ( 'removals' )? , ( 'additions' )? }
75
+ }
76
+ aria.prop.required = attribute aria-required { 'true' | 'false' }
77
+ aria.prop.setsize = attribute aria-setsize { datatype.non-negative.integer }
78
+ aria.prop.sort = attribute aria-sort { 'ascending '| 'descending' | 'none' | 'other' }
79
+ aria.prop.valuemax = attribute aria-valuemax { datatype.float }
80
+ aria.prop.valuemin = attribute aria-valuemin { datatype.float }
81
+ aria.prop.valuenow = attribute aria-valuenow { datatype.float }
82
+ aria.prop.valuetext = attribute aria-valuetext { datatype.string }
83
+
84
+
85
+ aria.roles = aria.widget.roles & aria.structure.roles & aria.landmark.roles
86
+
87
+ aria.widget.roles = 'alert' | 'alertdialog' | 'button' | 'checkbox' | 'dialog' |
88
+ 'gridcell' | 'link' | 'log' | 'marquee' | 'menuitem' | 'menuitemcheckbox' |
89
+ 'menuitemradio' | 'option' | 'progressbar' | 'radio' | 'scrollbar' | 'slider' |
90
+ 'spinbutton' | 'status' | 'tab' | 'tabpanel' | 'textbox' | 'timer' | 'tooltip' |
91
+ 'treeitem' | 'combobox' | 'grid' | 'listbox' | 'menu' | 'menubar' | 'radiogroup' |
92
+ 'tablist' | 'tree' | 'treegrid'
93
+
94
+ aria.structure.roles = 'article' | 'columnheader' | 'definition' | 'directory' |
95
+ 'document' | 'group' | 'heading' | 'img' | 'list' | 'listitem' | 'math' |
96
+ 'note' | 'presentation' | 'region' | 'row' | 'rowheader' | 'separator' |
97
+ 'toolbar'
98
+
99
+ aria.landmark.roles = 'application' | 'banner' | 'complementary' | 'contentinfo' |
100
+ 'form' | 'main' | 'navigation' | 'search'
101
+
102
+ aria.abstract.roles = 'command' | 'composite' | 'input' | 'landmark' | 'range'
103
+ | 'roletype' | 'section' | 'sectionhead' | 'select' | 'structure' | 'widget' |
104
+ 'window'
105
+
@@ -0,0 +1,44 @@
1
+
2
+
3
+
4
+ html5.global.attrs &= html5.global.common.attrs & html5.global.xml.attrs
5
+ html5.i18n.attrs = html5.xml.lang.attr? & html5.lang.attr? & html5.dir.attr?
6
+
7
+ html5.global.xml.attrs &= html5.xml.lang.attr? & html5.xml.base.attr? & html5.xml.space.attr?
8
+ html5.global.common.attrs &= html5.lang.attr? & html5.id.attr? & html5.title.attr? & html5.dir.attr? & html5.class.attr?
9
+
10
+
11
+
12
+ html5.lang.attr = attribute lang { datatype.languagecode }
13
+ html5.xml.lang.attr = attribute xml:lang { datatype.languagecode }
14
+ html5.dir.attr = attribute dir { 'ltr' | 'rtl' | 'auto' }
15
+ html5.id.attr = attribute id { datatype.ID }
16
+ html5.title.attr = attribute title { string }
17
+ html5.class.attr = attribute class { datatype.html5.space.separated.tokens }
18
+ html5.xml.base.attr = attribute xml:base { datatype.LEIRI }
19
+ html5.xml.space.attr = attribute xml:space { 'preserve' | 'default' }
20
+
21
+ html5.href.attr = attribute href { datatype.html5.URL.spaces }
22
+ html5.hreflang.attr = attribute hreflang { datatype.languagecode }
23
+ html5.target.attr = attribute target { datatype.html5.browsing.context.name.or.keyword }
24
+ html5.rel.attr = attribute rel { datatype.html5.space.separated.tokens }
25
+ html5.media.attr = attribute media { datatype.html5.media.query }
26
+
27
+ html5.type.mime.attr = attribute type { datatype.mimetype }
28
+ html5.type.mime.nocharset.attr = attribute type { datatype.mimetype.nocharset }
29
+
30
+ html5.charset.attr = attribute charset { datatype.character.encoding }
31
+
32
+ html5.src.attr = attribute src { datatype.html5.URL.spaces }
33
+ html5.usemap.attr = attribute usemap {datatype.html5.name.reference}
34
+
35
+ html5.cite.attr = attribute cite { datatype.html5.URL.spaces }
36
+ html5.alt.attr = attribute alt { datatype.string }
37
+
38
+ html5.name.context.attr = attribute name { datatype.html5.browsing.context.name }
39
+ html5.name.id.attr = attribute name { datatype.html5.name }
40
+
41
+ html5.dimension.attrs &= html5.width.attr? & html5.height.attr?
42
+ html5.width.attr = attribute width { datatype.non-negative.integer }
43
+ html5.height.attr = attribute height { datatype.non-negative.integer }
44
+
@@ -0,0 +1,44 @@
1
+
2
+
3
+ html5.html = element html { html5.html.attlist, html5.head, html5.body }
4
+ html5.html.attlist &= html5.global.attrs
5
+
6
+
7
+ html5.head = element head { html5.head.attlist & html5.head.content }
8
+ html5.head.attlist &= html5.global.attrs
9
+ html5.head.content = html5.title? & html5.base? & html5.metadata.class*
10
+ html5.metadata.class |= html5.link | html5.meta
11
+
12
+
13
+ html5.body = element body { html5.body.attlist & html5.body.content }
14
+ html5.body.attlist &= html5.global.attrs
15
+ html5.body.content = html5.section.model
16
+
17
+
18
+
19
+ html5.base = element base { html5.base.attlist }
20
+ html5.base.attlist &= html5.global.attrs &
21
+ ((html5.href.attr & html5.target.attr?) | html5.target.attr)
22
+
23
+ html5.link = element link { html5.link.attlist }
24
+ html5.link.attlist &= html5.global.attrs & html5.href.attr &
25
+ html5.rel.attr & html5.media.attr? & html5.hreflang.attr? &
26
+ html5.type.mime.attr? & html5.link.sizes.attr?
27
+ html5.link.sizes.attr = attribute sizes { 'any' | datatype.html5.sizes }
28
+
29
+ html5.meta = element meta { html5.meta.attlist }
30
+ html5.meta.attlist &= html5.global.attrs & (
31
+ (html5.meta.name.attr & html5.meta.content.attr)
32
+ | (html5.meta.http-equiv.attr & html5.meta.content.attr)
33
+ | html5.charset.attr )
34
+ html5.meta.name.attr = attribute name { datatype.string }
35
+ html5.meta.http-equiv.attr = attribute http-equiv { html5.meta.http-equiv.attr.content }
36
+ html5.meta.http-equiv.attr.content = ( 'content-language' | 'content-type' | 'default-style' | 'refresh' )
37
+ html5.meta.content.attr = attribute content { datatype.string }
38
+
39
+ html5.title = element title { html5.title.attlist & html5.title.content }
40
+ html5.title.attlist &= html5.global.attrs
41
+ html5.title.content = datatype.text
42
+
43
+
44
+
@@ -0,0 +1,24 @@
1
+
2
+
3
+ html5.flow.class |= html5.edit.flow.class
4
+ html5.phrasing.class |= html5.edit.phrasing.class
5
+
6
+ html5.edit.flow.class |= html5.ins.flow | html5.del.flow
7
+ html5.edit.phrasing.class |= html5.ins.phrasing | html5.del.phrasing
8
+
9
+
10
+ html5.ins.flow = element ins { html5.ins.attlist & html5.ins.flow.content }
11
+ html5.ins.phrasing = element ins { html5.ins.attlist & html5.ins.phrasing.content }
12
+ html5.ins.flow.content = html5.flow.model
13
+ html5.ins.phrasing.content = html5.phrasing.model
14
+ html5.ins.attlist &= html5.global.attrs & html5.cite.attr? & html5.edit.datetime.attr?
15
+
16
+
17
+ html5.del.flow = element del { html5.del.attlist & html5.del.flow.content }
18
+ html5.del.phrasing = element del { html5.del.attlist & html5.del.phrasing.content }
19
+
20
+ html5.del.flow.content = html5.flow.model
21
+ html5.del.phrasing.content = html5.phrasing.model
22
+ html5.del.attlist &= html5.global.attrs & html5.cite.attr? & html5.edit.datetime.attr?
23
+
24
+ html5.edit.datetime.attr = attribute datetime { datatype.html5.date.optional.time }
@@ -0,0 +1,155 @@
1
+
2
+
3
+ html5.flow.class |= html5.embed.flow.class
4
+ html5.phrasing.class |= html5.embed.phrasing.class
5
+
6
+ html5.embed.flow.class |= html5.audio.flow | html5.video.flow | html5.object.flow | html5.canvas.flow
7
+ | html5.map.flow | html5.area | html5.iframe | html5.img | html5.embed
8
+ html5.embed.phrasing.class |= html5.audio.phrasing | html5.video.phrasing | html5.object.phrasing | html5.canvas.phrasing
9
+ | html5.map.phrasing | html5.area | html5.iframe | html5.img | html5.embed
10
+
11
+
12
+
13
+ html5.video.flow = element video { html5.video.attlist & html5.video.flow.content }
14
+ html5.video.phrasing = element video { html5.video.attlist & html5.video.phrasing.content }
15
+ html5.video.attlist &= html5.global.attrs & html5.av.common.attrs & html5.video.poster.attr? & html5.dimension.attrs
16
+ html5.video.poster.attr = attribute poster { datatype.html5.URL.spaces }
17
+ html5.video.flow.content = html5.av.source, html5.track*, html5.flow.model
18
+ html5.video.phrasing.content = html5.av.source, html5.track*, html5.phrasing.model
19
+
20
+
21
+
22
+ html5.audio.flow = element audio { html5.audio.attlist & html5.audio.flow.content }
23
+ html5.audio.phrasing = element audio { html5.audio.attlist & html5.audio.phrasing.content }
24
+ html5.audio.attlist &= html5.global.attrs & html5.av.common.attrs
25
+ html5.audio.flow.content = html5.av.source, html5.track*, html5.flow.model
26
+ html5.audio.phrasing.content = html5.av.source, html5.track*, html5.phrasing.model
27
+
28
+ html5.av.source = html5.src.attr | html5.source*
29
+
30
+ html5.av.common.attrs = html5.av.autoplay.attr? & html5.av.preload.attr?
31
+ & html5.av.controls.attr? & html5.av.loop.attr? & html5.av.mediagroup.attr?
32
+ & html5.av.muted.attr?
33
+
34
+
35
+ html5.track = element track { html5.track.attlist }
36
+ html5.track.attlist &= html5.global.attrs & html5.track.kind.attr? & html5.src.attr & html5.track.default.attr?
37
+ & html5.track.srclang.attr? & html5.track.label.attr?
38
+
39
+ html5.track.kind.attr = attribute kind { 'subtitles' | 'captions' | 'descriptions' | 'chapters' | 'metadata' }
40
+ html5.track.srclang.attr = attribute srclang { datatype.languagecode }
41
+ html5.track.label.attr = attribute label { datatype.string }
42
+ html5.track.default.attr = attribute default { 'default' | '' }
43
+
44
+
45
+ html5.av.autoplay.attr = attribute autoplay { 'autoplay' | '' }
46
+ html5.av.preload.attr = attribute preload { 'none' | 'metadata' | 'auto' | '' }
47
+ html5.av.controls.attr = attribute controls { 'controls' | '' }
48
+ html5.av.loop.attr = attribute loop { 'loop' | '' }
49
+ html5.av.mediagroup.attr = attribute mediagroup { datatype.string }
50
+ html5.av.muted.attr = attribute muted { 'muted' | '' }
51
+
52
+ html5.source = element source { html5.source.attlist }
53
+ html5.source.attlist &= html5.global.attrs & html5.src.attr & html5.type.mime.attr? & html5.media.attr?
54
+
55
+
56
+
57
+
58
+ html5.img = element img { html5.img.attlist }
59
+ html5.img.attlist &= html5.global.attrs & html5.dimension.attrs & html5.src.attr & html5.alt.attr? & html5.usemap.attr? & html5.img.ismap.attr?
60
+ html5.img.ismap.attr = attribute ismap { 'ismap' | '' }
61
+
62
+
63
+
64
+ html5.embed = element embed { html5.embed.attlist }
65
+ html5.embed.attlist &= html5.global.attrs & html5.src.attr? & html5.type.mime.attr? & html5.dimension.attrs & html5.embed.attrs.other*
66
+ html5.embed.attrs.other = empty #TODO
67
+
68
+
69
+
70
+ html5.object.flow = element object { html5.object.flow.content & html5.object.attlist }
71
+ html5.object.phrasing = element object { html5.object.phrasing.content & html5.object.attlist }
72
+ html5.object.attlist &= html5.global.attrs & (( html5.object.data.attr & html5.type.mime.attr? ) | html5.type.mime.attr )
73
+ & html5.dimension.attrs & html5.usemap.attr? & html5.name.context.attr? & html5.forms.form.attr?
74
+ html5.object.data.attr = attribute data { datatype.html5.URL.spaces }
75
+
76
+ html5.object.flow.content = html5.param*, html5.flow.model
77
+ html5.object.phrasing.content = html5.param*, html5.phrasing.model
78
+
79
+ html5.param = element param { html5.param.attlist }
80
+ html5.param.attlist &= html5.global.attrs & html5.param.name.attr & html5.param.value.attr
81
+ html5.param.name.attr = attribute name { string }
82
+ html5.param.value.attr = attribute value { string }
83
+
84
+
85
+ html5.canvas.flow = element canvas { html5.canvas.attlist & html5.canvas.flow.content }
86
+ html5.canvas.phrasing = element canvas { html5.canvas.attlist & html5.canvas.phrasing.content }
87
+ html5.canvas.attlist = html5.global.attrs & html5.dimension.attrs
88
+ html5.canvas.flow.content = html5.flow.model
89
+ html5.canvas.phrasing.content = html5.phrasing.model
90
+
91
+
92
+ html5.map.flow = element map { html5.map.flow.content & html5.map.attlist }
93
+ html5.map.phrasing = element map { html5.map.phrasing.content & html5.map.attlist }
94
+ html5.map.attlist &= html5.global.attrs & html5.name.id.attr
95
+ html5.map.flow.content = html5.flow.model
96
+ html5.map.phrasing.content = html5.phrasing.model
97
+
98
+
99
+ html5.area = element area { html5.area.attlist }
100
+ html5.area.attlist &= html5.global.attrs & (html5.alt.attr & html5.href.attr)? & html5.target.attr? & html5.rel.attr?
101
+ & html5.media.attr? & html5.hreflang.attr? & html5.type.mime.attr? & html5.area.shape.attrs?
102
+
103
+ html5.area.shape.attrs =
104
+ ( html5.area.shape.rect.attr? & html5.area.coords.rect.attr )
105
+ |( html5.area.shape.circle.attr & html5.area.coords.circle.attr )
106
+ |( html5.area.shape.poly.attr & html5.area.coords.poly.attr )
107
+ |( html5.area.shape.default.attr )
108
+
109
+ html5.area.shape.rect.attr = attribute shape { 'rect' }
110
+ html5.area.coords.rect.attr = attribute coords { datatype.html5.coords.rectangle }
111
+ html5.area.shape.circle.attr = attribute shape { 'circle' }
112
+ html5.area.coords.circle.attr = attribute coords { datatype.html5.coords.circle }
113
+ html5.area.shape.poly.attr = attribute shape { 'poly' }
114
+ html5.area.coords.poly.attr = attribute coords {datatype.html5.coords.poly}
115
+ html5.area.shape.default.attr = attribute shape { 'default' }
116
+
117
+
118
+
119
+ html5.iframe = element iframe { html5.iframe.attlist & html5.iframe.content}
120
+ html5.iframe.attlist &= html5.global.attrs & html5.src.attr? & html5.name.context.attr?
121
+ & html5.dimension.attrs & html5.iframe.sandbox.attr? & html5.iframe.seamless.attr?
122
+ & html5.iframe.srcdoc.attr?
123
+ html5.iframe.seamless.attr = attribute seamless { 'seamless' | '' }
124
+ html5.iframe.sandbox.attr = attribute sandbox
125
+ { list { 'allow-top-navigation'?, 'allow-same-origin'?, 'allow-forms'?, 'allow-scripts'? }
126
+ | list { 'allow-top-navigation'?, 'allow-same-origin'?, 'allow-scripts'?, 'allow-forms'? }
127
+ | list { 'allow-top-navigation'?, 'allow-forms'?, 'allow-same-origin'?, 'allow-scripts'? }
128
+ | list { 'allow-top-navigation'?, 'allow-forms'?, 'allow-scripts'?, 'allow-same-origin'? }
129
+ | list { 'allow-top-navigation'?, 'allow-scripts'?, 'allow-same-origin'?, 'allow-forms'? }
130
+ | list { 'allow-top-navigation'?, 'allow-scripts'?, 'allow-forms'?, 'allow-same-origin'? }
131
+ | list { 'allow-same-origin'?, 'allow-top-navigation'?, 'allow-forms'?, 'allow-scripts'? }
132
+ | list { 'allow-same-origin'?, 'allow-top-navigation'?, 'allow-scripts'?, 'allow-forms'? }
133
+ | list { 'allow-forms'?, 'allow-top-navigation'?, 'allow-same-origin'?, 'allow-scripts'? }
134
+ | list { 'allow-forms'?, 'allow-top-navigation'?, 'allow-scripts'?, 'allow-same-origin'? }
135
+ | list { 'allow-scripts'?, 'allow-top-navigation'?, 'allow-same-origin'?, 'allow-forms'? }
136
+ | list { 'allow-scripts'?, 'allow-top-navigation'?, 'allow-forms'?, 'allow-same-origin'? }
137
+ | list { 'allow-same-origin'?, 'allow-forms'?, 'allow-top-navigation'?, 'allow-scripts'? }
138
+ | list { 'allow-same-origin'?, 'allow-scripts'?, 'allow-top-navigation'?, 'allow-forms'? }
139
+ | list { 'allow-forms'?, 'allow-same-origin'?, 'allow-top-navigation'?, 'allow-scripts'? }
140
+ | list { 'allow-forms'?, 'allow-scripts'?, 'allow-top-navigation'?, 'allow-same-origin'? }
141
+ | list { 'allow-scripts'?, 'allow-same-origin'?, 'allow-top-navigation'?, 'allow-forms'? }
142
+ | list { 'allow-scripts'?, 'allow-forms'?, 'allow-top-navigation'?, 'allow-same-origin'? }
143
+ | list { 'allow-same-origin'?, 'allow-forms'?, 'allow-scripts'?, 'allow-top-navigation'? }
144
+ | list { 'allow-same-origin'?, 'allow-scripts'?, 'allow-forms'?, 'allow-top-navigation'? }
145
+ | list { 'allow-forms'?, 'allow-same-origin'?, 'allow-scripts'?, 'allow-top-navigation'? }
146
+ | list { 'allow-forms'?, 'allow-scripts'?, 'allow-same-origin'?, 'allow-top-navigation'? }
147
+ | list { 'allow-scripts'?, 'allow-same-origin'?, 'allow-forms'?, 'allow-top-navigation'? }
148
+ | list { 'allow-scripts'?, 'allow-forms'?, 'allow-same-origin'?, 'allow-top-navigation'? }
149
+ }
150
+ html5.iframe.srcdoc.attr = attribute srcdoc { datatype.html5.iframe.srcdoc.xml }
151
+
152
+ html5.iframe.content = html5.iframe.content.xml
153
+ html5.iframe.content.html = datatype.text
154
+ html5.iframe.content.xml = empty
155
+