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,25 @@
1
+ # Lenient-Signature-exclusiveC14N.rnc
2
+ #
3
+ # Copyright 2011 W3C (Massachusetts Institute of Technology,
4
+ # Institut National de Recherche en Informatique et en Automatique,
5
+ # Keio University). All Rights Reserved. http://www.w3.org/Consortium/Legal/
6
+ #
7
+ # Use and distribution of all schemas in this directory are permitted under the terms
8
+ # W3C Software Notice and License
9
+ # http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
10
+
11
+ namespace ds = "http://www.w3.org/2000/09/xmldsig#"
12
+ namespace ec = "http://www.w3.org/2001/10/xml-exc-c14n#"
13
+
14
+ start = anyForeignElementOrSignature
15
+ anyForeignElementOrSignature =
16
+ element * - ds:* {
17
+ mixed { security_anyAttribute*, anyForeignElementOrSignature* } }
18
+ | ds_Signature
19
+ ds_anyForeignElement = element * - ds:* {
20
+ mixed { security_anyAttribute*, security_anyElement* } }
21
+
22
+ include "security_any.rnc"
23
+ include "xmldsig-core-schema.rnc"
24
+ include "xmldsig-allowAnyForeign.rnc"
25
+ include "exc-c14n.rnc"
@@ -0,0 +1,32 @@
1
+ # Lenient-Signature11-properties-exclusiveC14N.rnc
2
+ #
3
+ # Copyright 2011 W3C (Massachusetts Institute of Technology,
4
+ # Institut National de Recherche en Informatique et en Automatique,
5
+ # Keio University). All Rights Reserved. http://www.w3.org/Consortium/Legal/
6
+ #
7
+ # Use and distribution of all schemas in this directory are permitted under the terms
8
+ # W3C Software Notice and License
9
+ # http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
10
+
11
+ namespace ds = "http://www.w3.org/2000/09/xmldsig#"
12
+ namespace ds11 = "http://www.w3.org/2009/xmldsig11#"
13
+ namespace dsp = "http://www.w3.org/2009/xmldsig-properties"
14
+ namespace ec = "http://www.w3.org/2001/10/xml-exc-c14n#"
15
+
16
+ start = anyForeignElementOrSignature
17
+ anyForeignElementOrSignature =
18
+ element * - (ds:* | ds11:* | dsp:* | ec:*) {
19
+ mixed { security_anyAttribute*, anyForeignElementOrSignature* } }
20
+ | ds_Signature
21
+ ds_anyForeignElement = element * - ds:* {
22
+ mixed { security_anyAttribute*, security_anyElement* } }
23
+ dsig11_anyForeignElement = element * - ds11:* {
24
+ mixed { security_anyAttribute*, security_anyElement* } }
25
+
26
+ include "security_any.rnc"
27
+ include "xmldsig-core-schema.rnc"
28
+ include "xmldsig11-schema.rnc"
29
+ include "xmldsig-allowAnyForeign.rnc"
30
+ include "xmldsig11-allowAnyForeign.rnc"
31
+ include "xmldsig-properties-schema.rnc"
32
+ include "exc-c14n.rnc"
@@ -0,0 +1,30 @@
1
+ # Lenient-Signature11-properties.rnc
2
+ #
3
+ # Copyright 2011 W3C (Massachusetts Institute of Technology,
4
+ # Institut National de Recherche en Informatique et en Automatique,
5
+ # Keio University). All Rights Reserved. http://www.w3.org/Consortium/Legal/
6
+ #
7
+ # Use and distribution of all schemas in this directory are permitted under the terms
8
+ # W3C Software Notice and License
9
+ # http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
10
+
11
+ namespace ds = "http://www.w3.org/2000/09/xmldsig#"
12
+ namespace ds11 = "http://www.w3.org/2009/xmldsig11#"
13
+ namespace dsp = "http://www.w3.org/2009/xmldsig-properties"
14
+
15
+ start = anyForeignElementOrSignature
16
+ anyForeignElementOrSignature =
17
+ element * - (ds:* | ds11:* | dsp:*) {
18
+ mixed { security_anyAttribute*, anyForeignElementOrSignature* } }
19
+ | ds_Signature
20
+ ds_anyForeignElement = element * - ds:* {
21
+ mixed { security_anyAttribute*, security_anyElement* } }
22
+ dsig11_anyForeignElement = element * - ds11:* {
23
+ mixed { security_anyAttribute*, security_anyElement* } }
24
+
25
+ include "security_any.rnc"
26
+ include "xmldsig-core-schema.rnc"
27
+ include "xmldsig11-schema.rnc"
28
+ include "xmldsig-allowAnyForeign.rnc"
29
+ include "xmldsig11-allowAnyForeign.rnc"
30
+ include "xmldsig-properties-schema.rnc"
@@ -0,0 +1,28 @@
1
+ # Lenient-Signature11.rnc
2
+ #
3
+ # Copyright 2011 W3C (Massachusetts Institute of Technology,
4
+ # Institut National de Recherche en Informatique et en Automatique,
5
+ # Keio University). All Rights Reserved. http://www.w3.org/Consortium/Legal/
6
+ #
7
+ # Use and distribution of all schemas in this directory are permitted under the terms
8
+ # W3C Software Notice and License
9
+ # http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
10
+
11
+ namespace ds = "http://www.w3.org/2000/09/xmldsig#"
12
+ namespace ds11 = "http://www.w3.org/2009/xmldsig11#"
13
+
14
+ start = anyForeignElementOrSignature
15
+ anyForeignElementOrSignature =
16
+ element * - (ds:* | ds11:*) {
17
+ mixed { security_anyAttribute*, anyForeignElementOrSignature* } }
18
+ | ds_Signature
19
+ ds_anyForeignElement = element * - ds:* {
20
+ mixed { security_anyAttribute*, security_anyElement* } }
21
+ dsig11_anyForeignElement = element * - ds11:* {
22
+ mixed { security_anyAttribute*, security_anyElement* } }
23
+
24
+ include "security_any.rnc"
25
+ include "xmldsig-core-schema.rnc"
26
+ include "xmldsig11-schema.rnc"
27
+ include "xmldsig-allowAnyForeign.rnc"
28
+ include "xmldsig11-allowAnyForeign.rnc"
@@ -0,0 +1,27 @@
1
+ # Strict-Encryption.rnc
2
+ #
3
+ # Copyright 2011 W3C (Massachusetts Institute of Technology,
4
+ # Institut National de Recherche en Informatique et en Automatique,
5
+ # Keio University). All Rights Reserved. http://www.w3.org/Consortium/Legal/
6
+ #
7
+ # Use and distribution of all schemas in this directory are permitted under the terms
8
+ # W3C Software Notice and License
9
+ # http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
10
+
11
+ namespace ds = "http://www.w3.org/2000/09/xmldsig#"
12
+ namespace xenc = "http://www.w3.org/2001/04/xmlenc#"
13
+
14
+ start = anyForeignElementOrEncrypted
15
+ anyForeignElementOrEncrypted =
16
+ element * - xenc:* {
17
+ mixed { security_anyAttribute*, anyForeignElementOrEncrypted* } }
18
+ | xenc_EncryptedData
19
+ | xenc_EncryptedKey
20
+ ds_anyForeignElement = element * - (ds:* | xenc:*) {
21
+ mixed { security_anyAttribute*, security_anyElement* } }
22
+ xenc_anyForeignElement = element * - xenc:* {
23
+ mixed { security_anyAttribute*, security_anyElement* } }
24
+
25
+ include "security_any.rnc"
26
+ include "xmldsig-core-schema.rnc"
27
+ include "xenc-schema.rnc"
@@ -0,0 +1,22 @@
1
+ # Strict-Signature.rnc
2
+ #
3
+ # Copyright 2011 W3C (Massachusetts Institute of Technology,
4
+ # Institut National de Recherche en Informatique et en Automatique,
5
+ # Keio University). All Rights Reserved. http://www.w3.org/Consortium/Legal/
6
+ #
7
+ # Use and distribution of all schemas in this directory are permitted under the terms
8
+ # W3C Software Notice and License
9
+ # http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
10
+
11
+ namespace ds = "http://www.w3.org/2000/09/xmldsig#"
12
+
13
+ start = anyForeignElementOrSignature
14
+ anyForeignElementOrSignature =
15
+ element * - ds:* {
16
+ mixed { security_anyAttribute*, anyForeignElementOrSignature* } }
17
+ | ds_Signature
18
+ ds_anyForeignElement = element * - ds:* {
19
+ mixed { security_anyAttribute*, security_anyElement* } }
20
+
21
+ include "security_any.rnc"
22
+ include "xmldsig-core-schema.rnc"
@@ -0,0 +1,39 @@
1
+ # exc-c14n.rnc (derived from exc-c14n.xsd)
2
+ #
3
+ # Copyright 2011 W3C (Massachusetts Institute of Technology,
4
+ # Institut National de Recherche en Informatique et en Automatique,
5
+ # Keio University). All Rights Reserved. http://www.w3.org/Consortium/Legal/
6
+ #
7
+ # Use and distribution of all schemas in this directory are permitted under the terms
8
+ # W3C Software Notice and License
9
+ # http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
10
+ #
11
+ # This RELAX NG schema allows the use of two algorithms, namely
12
+ #
13
+ # http://www.w3.org/2001/10/xml-exc-c14n# and
14
+ # http://www.w3.org/2001/10/xml-exc-c14n#WithComments,
15
+ #
16
+ # in ds_CanonicalizationMethodType, which specifies permissible
17
+ # contents of Transform or CanonicalizationMethod elements.
18
+ #
19
+ # The definition of ds_CanonicalizationMethodType in this schema is
20
+ # combined with the other definitions of ds_CanonicalizationMethodType
21
+ # by the choice operator.
22
+
23
+ default namespace = "http://www.w3.org/2001/10/xml-exc-c14n#"
24
+
25
+ ds_CanonicalizationMethodType |=
26
+ attribute Algorithm {
27
+ xsd:anyURI "http://www.w3.org/2001/10/xml-exc-c14n#"
28
+ | xsd:anyURI "http://www.w3.org/2001/10/xml-exc-c14n#WithComments"
29
+ },
30
+ ec_InclusiveNamespaces?
31
+ ec_InclusiveNamespaces =
32
+ element InclusiveNamespaces {
33
+ attribute PrefixList { xsd:NMTOKENS }
34
+ }
35
+
36
+ # List of known algorithms
37
+ ds_CanonicalizationAlgorithms |=
38
+ xsd:anyURI "http://www.w3.org/2001/10/xml-exc-c14n#"
39
+ | xsd:anyURI "http://www.w3.org/2001/10/xml-exc-c14n#WithComments"
@@ -0,0 +1,15 @@
1
+ # security_any.rnc
2
+ #
3
+ # Copyright 2011 W3C (Massachusetts Institute of Technology,
4
+ # Institut National de Recherche en Informatique et en Automatique,
5
+ # Keio University). All Rights Reserved. http://www.w3.org/Consortium/Legal/
6
+ #
7
+ # Use and distribution of all schemas in this directory are permitted under the terms
8
+ # W3C Software Notice and License
9
+ # http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
10
+ #
11
+ # This RELAX NG schema defines security_anyElement, which allows any element,
12
+ # and security_anyAttribute, which allows any attribute.
13
+
14
+ security_anyElement = element * { mixed { security_anyAttribute*, security_anyElement* } }
15
+ security_anyAttribute = attribute * { text }
@@ -0,0 +1,25 @@
1
+ # xenc-allowAnyForeign.rnc
2
+ #
3
+ # Copyright 2011 W3C (Massachusetts Institute of Technology,
4
+ # Institut National de Recherche en Informatique et en Automatique,
5
+ # Keio University). All Rights Reserved. http://www.w3.org/Consortium/Legal/
6
+ #
7
+ # Use and distribution of all schemas in this directory are permitted under the terms
8
+ # W3C Software Notice and License
9
+ # http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
10
+ #
11
+ # This schema mimicks <any namespace='##other'.../>
12
+ # in xenc-schema.xsd.
13
+ #
14
+ # Schema authors might want to create a dedicated schema
15
+ # for a collection of particular algorithms rather than
16
+ # using this schema.
17
+
18
+ xenc_EncryptionMethodOtherParams |=
19
+ attribute Algorithm {
20
+ xsd:anyURI - xenc_EncryptionAlgorithms },
21
+ xenc_anyForeignElement*
22
+ xenc_AgreementMethodParams |=
23
+ attribute Algorithm {
24
+ xsd:anyURI - xenc_KeyAgreementAlgorithms },
25
+ xenc_anyForeignElement*
@@ -0,0 +1,96 @@
1
+ # xenc-schema-11.rnc (derived from xenc-schema.xsd)
2
+ #
3
+ # Copyright 2011 W3C (Massachusetts Institute of Technology,
4
+ # Institut National de Recherche en Informatique et en Automatique,
5
+ # Keio University). All Rights Reserved. http://www.w3.org/Consortium/Legal/
6
+ #
7
+ # Use and distribution of all schemas in this directory are permitted under the terms
8
+ # W3C Software Notice and License
9
+ # http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
10
+ #
11
+ # This schema complements "xenc-schema.rnc" by introducing
12
+ # elements specific to 1.1. Note that the definitions of
13
+ # xenc_EncryptionMethodOtherParams and
14
+ # xenc_AgreementMethodParams have been extended so that
15
+ # elements specific to 1.1 are allowed.
16
+
17
+ default namespace = "http://www.w3.org/2009/xmlenc11#"
18
+ namespace ds = "http://www.w3.org/2000/09/xmldsig#"
19
+ namespace xenc = "http://www.w3.org/2001/04/xmlenc#"
20
+ namespace xenc11 = "http://www.w3.org/2009/xmlenc11#"
21
+
22
+ xenc11_ConcatKDFParams =
23
+ element ConcatKDFParams { xenc11_ConcatKDFParamsType }
24
+ xenc11_ConcatKDFParamsType =
25
+ attribute AlgorithmID { xsd:hexBinary }?,
26
+ attribute PartyUInfo { xsd:hexBinary }?,
27
+ attribute PartyVInfo { xsd:hexBinary }?,
28
+ attribute SuppPubInfo { xsd:hexBinary }?,
29
+ attribute SuppPrivInfo { xsd:hexBinary }?,
30
+ ds_DigestMethod
31
+ xenc11_DerivedKey = element DerivedKey { xenc11_DerivedKeyType }
32
+ xenc11_DerivedKeyType =
33
+ attribute Recipient { xsd:string }?,
34
+ attribute Id { xenc11_IdType }?,
35
+ attribute Type { xsd:anyURI }?,
36
+ xenc11_KeyDerivationMethod?,
37
+ xenc_ReferenceList?,
38
+ element DerivedKeyName { xsd:string }?,
39
+ element MasterKeyName { xsd:string }?
40
+ xenc11_KeyDerivationMethod =
41
+ element KeyDerivationMethod { xenc11_KeyDerivationMethodType }
42
+ xenc11_KeyDerivationMethodType =
43
+ (attribute Algorithm { xsd:anyURI "http://www.w3.org/2009/xmlenc11#ConcatKDF" },
44
+ xenc11_ConcatKDFParams)
45
+ | (attribute Algorithm { xsd:anyURI "http://www.w3.org/2009/xmlenc11#pbkdf2" },
46
+ xenc11_PBKDF2-params)
47
+ xenc11_PBKDF2-params =
48
+ element PBKDF2-params { xenc11_PBKDF2ParameterType }
49
+ xenc11_AlgorithmIdentifierType =
50
+ attribute Algorithm { xsd:anyURI },
51
+ element Parameters { security_anyAttribute*, mixed { security_anyElement* } }?
52
+ xenc11_PRFAlgorithmIdentifierType =
53
+ # Restricts xenc11:AlgorithmIdentifierType
54
+ attribute Algorithm { xsd:anyURI }
55
+ xenc11_PBKDF2ParameterType =
56
+ element Salt {
57
+ element Specified { xsd:base64Binary }
58
+ | element OtherSource { xenc11_AlgorithmIdentifierType }
59
+ },
60
+ element IterationCount { xsd:positiveInteger },
61
+ element KeyLength { xsd:positiveInteger },
62
+ element PRF { xenc11_PRFAlgorithmIdentifierType }
63
+
64
+ xenc11_IdType = xsd:NCName # xsd:ID does not work
65
+
66
+ xenc_EncryptionMethodOtherParams |=
67
+ attribute Algorithm {
68
+ # Block Encryption
69
+ xsd:anyURI "http://www.w3.org/2009/xmlenc11#aes128-gcm"
70
+ | xsd:anyURI "http://www.w3.org/2009/xmlenc11#aes256-gcm"
71
+ # Symmetric Key Wrap
72
+ | xsd:anyURI "http://www.w3.org/2009/xmlenc11#kw-aes-128-pad"
73
+ | xsd:anyURI "http://www.w3.org/2009/xmlenc11#kw-aes-192-pad"
74
+ | xsd:anyURI "http://www.w3.org/2009/xmlenc11#kw-aes-256-pad"
75
+ }
76
+
77
+ xenc_AgreementMethodParams |=
78
+ attribute Algorithm { xsd:anyURI "http://www.w3.org/2009/xmlenc11#dh-es" }
79
+ | attribute Algorithm { xsd:anyURI "http://www.w3.org/2009/xmlenc11#ECDH-ES" }
80
+
81
+
82
+ # List of known algorithms
83
+ xenc_EncryptionAlgorithms |=
84
+ # Block Encryption
85
+ xsd:anyURI "http://www.w3.org/2009/xmlenc11#aes128-gcm"
86
+ | xsd:anyURI "http://www.w3.org/2009/xmlenc11#aes256-gcm"
87
+ # Symmetric Key Wrap
88
+ | xsd:anyURI "http://www.w3.org/2009/xmlenc11#kw-aes-128-pad"
89
+ | xsd:anyURI "http://www.w3.org/2009/xmlenc11#kw-aes-192-pad"
90
+ | xsd:anyURI "http://www.w3.org/2009/xmlenc11#kw-aes-256-pad"
91
+ xenc_KeyAgreementAlgorithms |=
92
+ xsd:anyURI "http://www.w3.org/2009/xmlenc11#dh-es"
93
+ | xsd:anyURI "http://www.w3.org/2009/xmlenc11#ECDH-ES"
94
+ xenc11_KeyDerivationAlgorithms =
95
+ xsd:anyURI "http://www.w3.org/2009/xmlenc11#ConcatKDF"
96
+ | xsd:anyURI "http://www.w3.org/2009/xmlenc11#pbkdf2"
@@ -0,0 +1,145 @@
1
+ # xenc-schema.rnc (derived from xenc-schema.xsd)
2
+ #
3
+ # Copyright 2011 W3C (Massachusetts Institute of Technology,
4
+ # Institut National de Recherche en Informatique et en Automatique,
5
+ # Keio University). All Rights Reserved. http://www.w3.org/Consortium/Legal/
6
+ #
7
+ # Use and distribution of all schemas in this directory are permitted under the terms
8
+ # W3C Software Notice and License
9
+ # http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
10
+ #
11
+ #It is assumed that the driver schema imports xmldsig-core-schema.rnc.
12
+
13
+
14
+ default namespace = "http://www.w3.org/2001/04/xmlenc#"
15
+ namespace xenc = "http://www.w3.org/2001/04/xmlenc#"
16
+
17
+ ds_KeyValueType |= xenc_DHKeyValue
18
+ ds_DigestMethodType |=
19
+ attribute Algorithm {
20
+ xsd:anyURI "http://www.w3.org/2001/04/xmlenc#sha256"
21
+ | xsd:anyURI "http://www.w3.org/2001/04/xmlenc#sha512"
22
+ | xsd:anyURI "http://www.w3.org/2001/04/xmlenc#ripemd160"
23
+ }
24
+
25
+ xenc_EncryptedType =
26
+ attribute Id { xenc_IdType }?,
27
+ attribute Type { xsd:anyURI }?,
28
+ attribute MimeType { xsd:string }?,
29
+ attribute Encoding { xsd:anyURI }?,
30
+ element EncryptionMethod { xenc_EncryptionMethodType }?,
31
+ ds_KeyInfo?,
32
+ xenc_CipherData,
33
+ xenc_EncryptionProperties?
34
+ xenc_EncryptionMethodType =
35
+ mixed {
36
+ element KeySize { xenc_KeySizeType }?,
37
+ xenc_EncryptionMethodOtherParams
38
+ }
39
+
40
+ ds_KeyInfoChild |= xenc_EncryptedKey | xenc_AgreementMethod
41
+
42
+ xenc_EncryptionMethodOtherParams =
43
+ attribute Algorithm { xsd:anyURI "http://www.w3.org/2001/04/xmlenc#tripledes-cbc" }
44
+ | attribute Algorithm { xsd:anyURI "http://www.w3.org/2001/04/xmlenc#aes128-cbc" }
45
+ | attribute Algorithm { xsd:anyURI "http://www.w3.org/2001/04/xmlenc#aes256-cbc" }
46
+ | attribute Algorithm { xsd:anyURI "http://www.w3.org/2001/04/xmlenc#aes192-cbc" }
47
+ | attribute Algorithm { xsd:anyURI "http://www.w3.org/2001/04/xmlenc#rsa-1_5" }
48
+ | (attribute Algorithm { xsd:anyURI "http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p" },
49
+ element OAEPparams { xsd:base64Binary }?,
50
+ ds_DigestMethod?)
51
+ | attribute Algorithm { xsd:anyURI "http://www.w3.org/2001/04/xmlenc#kw-tripledes" }
52
+ | attribute Algorithm {
53
+ xsd:anyURI "http://www.w3.org/2001/04/xmlenc#kw-aes128"
54
+ | xsd:anyURI "http://www.w3.org/2001/04/xmlenc#kw-aes192"
55
+ | xsd:anyURI "http://www.w3.org/2001/04/xmlenc#kw-aes256"
56
+ }
57
+
58
+ xenc_KeySizeType = xsd:integer
59
+ xenc_CipherData = element CipherData { xenc_CipherDataType }
60
+ xenc_CipherDataType =
61
+ element CipherValue { xsd:base64Binary }
62
+ | xenc_CipherReference
63
+ xenc_CipherReference =
64
+ element CipherReference { xenc_CipherReferenceType }
65
+ xenc_CipherReferenceType =
66
+ attribute URI { xsd:anyURI },
67
+ element Transforms { xenc_TransformsType }?
68
+ xenc_TransformsType = ds_Transform+
69
+ xenc_EncryptedData = element EncryptedData { xenc_EncryptedDataType }
70
+ xenc_EncryptedDataType = xenc_EncryptedType
71
+ xenc_EncryptedKey = element EncryptedKey { xenc_EncryptedKeyType }
72
+ xenc_EncryptedKeyType =
73
+ xenc_EncryptedType,
74
+ xenc_ReferenceList?,
75
+ element CarriedKeyName { xsd:string }?,
76
+ attribute Recipient { xsd:string }?
77
+ xenc_AgreementMethod =
78
+ element AgreementMethod { xenc_AgreementMethodType }
79
+ xenc_AgreementMethodType =
80
+ mixed {
81
+ element KA-Nonce { xsd:base64Binary }?,
82
+ xenc_AgreementMethodParams,
83
+ element OriginatorKeyInfo { ds_KeyInfoType }?,
84
+ element RecipientKeyInfo { ds_KeyInfoType }?
85
+ }
86
+ xenc_AgreementMethodParams =
87
+ attribute Algorithm { xsd:anyURI "http://www.w3.org/2001/04/xmlenc#dh" },
88
+ ds_DigestMethod
89
+
90
+ xenc_ReferenceList =
91
+ element ReferenceList {
92
+ (element DataReference { xenc_ReferenceType }
93
+ | element KeyReference { xenc_ReferenceType })+
94
+ }
95
+ xenc_ReferenceType =
96
+ attribute URI { xsd:anyURI },
97
+ xenc_anyForeignElement*
98
+ #For both types of references one may optionally specify child elements to aid the recipient in retrieving the EncryptedKey and/or EncryptedData elements. These could include information such as XPath transforms, decompression transforms, or information on how to retrieve the elements from a document storage facility. For example:
99
+ #ds_Transforms
100
+
101
+ xenc_EncryptionProperties =
102
+ element EncryptionProperties { xenc_EncryptionPropertiesType }
103
+ xenc_EncryptionPropertiesType =
104
+ attribute Id { xenc_IdType }?,
105
+ xenc_EncryptionProperty+
106
+ xenc_EncryptionProperty =
107
+ element EncryptionProperty { xenc_EncryptionPropertyType }
108
+ xenc_EncryptionPropertyType =
109
+ mixed {
110
+ attribute Target { xsd:anyURI }?,
111
+ attribute Id { xenc_IdType }?,
112
+ attribute xml:* { text }*,
113
+ xenc_anyForeignElement+
114
+ }
115
+
116
+ xenc_DHKeyValue = element DHKeyValue { xenc_DHKeyValueType }
117
+ xenc_DHKeyValueType =
118
+ (element P { ds_CryptoBinary },
119
+ element Q { ds_CryptoBinary },
120
+ element Generator { ds_CryptoBinary })?,
121
+ element Public { ds_CryptoBinary },
122
+ (element seed { ds_CryptoBinary },
123
+ element pgenCounter { ds_CryptoBinary })?
124
+
125
+ xenc_IdType = xsd:NCName # xsd:ID does not work
126
+
127
+ ds_DigestAlgorithms |=
128
+ xsd:anyURI "http://www.w3.org/2001/04/xmlenc#sha256"
129
+ | xsd:anyURI "http://www.w3.org/2001/04/xmlenc#sha512"
130
+ | xsd:anyURI "http://www.w3.org/2001/04/xmlenc#ripemd160"
131
+
132
+ xenc_EncryptionAlgorithms =
133
+ xsd:anyURI "http://www.w3.org/2001/04/xmlenc#tripledes-cbc"
134
+ | xsd:anyURI "http://www.w3.org/2001/04/xmlenc#aes128-cbc"
135
+ | xsd:anyURI "http://www.w3.org/2001/04/xmlenc#aes256-cbc"
136
+ | xsd:anyURI "http://www.w3.org/2001/04/xmlenc#aes192-cbc"
137
+ | xsd:anyURI "http://www.w3.org/2001/04/xmlenc#rsa-1_5"
138
+ | xsd:anyURI "http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p"
139
+ | xsd:anyURI "http://www.w3.org/2001/04/xmlenc#kw-tripledes"
140
+ | xsd:anyURI "http://www.w3.org/2001/04/xmlenc#kw-aes128"
141
+ | xsd:anyURI "http://www.w3.org/2001/04/xmlenc#kw-aes256"
142
+ | xsd:anyURI "http://www.w3.org/2001/04/xmlenc#kw-aes192"
143
+
144
+ xenc_KeyAgreementAlgorithms =
145
+ xsd:anyURI "http://www.w3.org/2001/04/xmlenc#dh"
@@ -0,0 +1,19 @@
1
+ # xenc11-allowAnyForeign.rnc
2
+ #
3
+ # Copyright 2011 W3C (Massachusetts Institute of Technology,
4
+ # Institut National de Recherche en Informatique et en Automatique,
5
+ # Keio University). All Rights Reserved. http://www.w3.org/Consortium/Legal/
6
+ #
7
+ # Use and distribution of all schemas in this directory are permitted under the terms
8
+ # W3C Software Notice and License
9
+ # http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
10
+ #
11
+ # This schema mimicks <any .. /> in xenc-schema-11.xsd.
12
+ #
13
+ # Schema authors might want to create a dedicated schema
14
+ # for a collection of particular algorithms rather than
15
+ # using this schema.
16
+
17
+ xenc11_KeyDerivationMethodType |=
18
+ attribute Algorithm { xsd:anyURI - xenc11_KeyDerivationAlgorithms },
19
+ xenc11_anyForeignElement*
@@ -0,0 +1,47 @@
1
+ # xmldsig-allowAnyForeign.rnc
2
+ #
3
+ # Copyright 2011 W3C (Massachusetts Institute of Technology,
4
+ # Institut National de Recherche en Informatique et en Automatique,
5
+ # Keio University). All Rights Reserved. http://www.w3.org/Consortium/Legal/
6
+ #
7
+ # Use and distribution of all schemas in this directory are permitted under the terms
8
+ # W3C Software Notice and License
9
+ # http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
10
+ #
11
+ # This schema mimicks <any ../> in xmldsig-core-schema.xsd.
12
+ # When namespace="##other", any foreign element is allowed.
13
+ # When namespace="##any", any foreign element as well as
14
+ # any element valid against xmldsig-core-schema.xsd is allowed.
15
+ #
16
+ # Schema authors might want to create a dedicated schema
17
+ # for a collection of particular algorithms rather than
18
+ # using this schema.
19
+
20
+ default namespace ds = "http://www.w3.org/2000/09/xmldsig#"
21
+
22
+ ds_CanonicalizationMethodType |=
23
+ attribute Algorithm { xsd:anyURI - ds_CanonicalizationAlgorithms },
24
+ (ds_anyForeignElement | ds_anyDsElement)*
25
+ ds_SignatureMethodType |=
26
+ attribute Algorithm { xsd:anyURI - ds_SignatureAlgorithms },
27
+ # It is allowed to use an HMACOutputLength element even when
28
+ # the agorithm is not "http://www.w3.org/2000/09/xmldsig#hmac-sha1"
29
+ element HMACOutputLength { ds_HMACOutputLengthType }?,
30
+ ds_anyForeignElement*
31
+ ds_TransformType |=
32
+ attribute Algorithm {
33
+ xsd:anyURI - (ds_CanonicalizationAlgorithms | ds_TransformAlgorithms) },
34
+ # It is allowed to use XPath elements even when
35
+ # the algorithm is not "http://www.w3.org/TR/1999/REC-xpath-19991116"
36
+ (ds_anyForeignElement
37
+ | element XPath { xsd:string })*
38
+ ds_DigestMethodType |=
39
+ attribute Algorithm { xsd:anyURI - ds_DigestAlgorithms },
40
+ ds_anyForeignElement*
41
+ ds_KeyInfoChild |= ds_anyForeignElement
42
+ ds_KeyValueType |= ds_anyForeignElement
43
+ ds_X509DataForeignChild |= ds_anyForeignElement
44
+ ds_SPKIDataForeignChild |= ds_anyForeignElement
45
+ ds_ObjectChild |= ds_anyForeignElement
46
+ ds_SignaturePropertyChild |= ds_anyForeignElement
47
+ ds_PGPDataForeignChild |= ds_anyForeignElement