rgen 0.3.0 → 0.4.0

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 (145) hide show
  1. data/CHANGELOG +20 -1
  2. data/MIT-LICENSE +1 -1
  3. data/README +12 -9
  4. data/lib/instantiators/ea_instantiator.rb +36 -0
  5. data/lib/metamodels/uml13_metamodel.rb +559 -0
  6. data/lib/metamodels/uml13_metamodel_ext.rb +26 -0
  7. data/lib/mmgen/metamodel_generator.rb +5 -5
  8. data/lib/mmgen/mm_ext/ecore_ext.rb +95 -0
  9. data/lib/mmgen/mmgen.rb +6 -4
  10. data/lib/mmgen/templates/annotations.tpl +37 -0
  11. data/lib/mmgen/templates/metamodel_generator.tpl +171 -0
  12. data/lib/rgen/ecore/ecore.rb +190 -0
  13. data/lib/rgen/ecore/ecore_instantiator.rb +25 -0
  14. data/lib/rgen/ecore/ecore_transformer.rb +85 -0
  15. data/lib/rgen/environment.rb +9 -24
  16. data/lib/rgen/find_helper.rb +68 -0
  17. data/lib/rgen/{instantiator.rb → instantiator/abstract_instantiator.rb} +6 -2
  18. data/lib/rgen/instantiator/abstract_xml_instantiator.rb +59 -0
  19. data/lib/rgen/instantiator/default_xml_instantiator.rb +117 -0
  20. data/lib/rgen/instantiator/ecore_xml_instantiator.rb +144 -0
  21. data/lib/rgen/instantiator/nodebased_xml_instantiator.rb +157 -0
  22. data/lib/rgen/instantiator/xmi11_instantiator.rb +164 -0
  23. data/lib/rgen/metamodel_builder.rb +103 -9
  24. data/lib/rgen/metamodel_builder/build_helper.rb +26 -4
  25. data/lib/rgen/metamodel_builder/builder_extensions.rb +285 -88
  26. data/lib/rgen/metamodel_builder/builder_runtime.rb +7 -1
  27. data/lib/rgen/metamodel_builder/data_types.rb +67 -0
  28. data/lib/rgen/metamodel_builder/intermediate/annotation.rb +30 -0
  29. data/lib/rgen/metamodel_builder/metamodel_description.rb +232 -0
  30. data/lib/rgen/metamodel_builder/mm_multiple.rb +23 -0
  31. data/lib/rgen/metamodel_builder/module_extension.rb +33 -0
  32. data/lib/rgen/model_comparator.rb +56 -0
  33. data/lib/rgen/model_dumper.rb +5 -5
  34. data/lib/rgen/name_helper.rb +17 -1
  35. data/lib/rgen/template_language.rb +148 -28
  36. data/lib/rgen/template_language/directory_template_container.rb +56 -38
  37. data/lib/rgen/template_language/output_handler.rb +93 -77
  38. data/lib/rgen/template_language/template_container.rb +186 -143
  39. data/lib/rgen/transformer.rb +19 -14
  40. data/lib/transformers/uml13_to_ecore.rb +75 -0
  41. data/redist/xmlscan/ChangeLog +1301 -0
  42. data/redist/xmlscan/README +34 -0
  43. data/redist/xmlscan/THANKS +11 -0
  44. data/redist/xmlscan/doc/changes.html +74 -0
  45. data/redist/xmlscan/doc/changes.rd +80 -0
  46. data/redist/xmlscan/doc/en/conformance.html +136 -0
  47. data/redist/xmlscan/doc/en/conformance.rd +152 -0
  48. data/redist/xmlscan/doc/en/manual.html +356 -0
  49. data/redist/xmlscan/doc/en/manual.rd +402 -0
  50. data/redist/xmlscan/doc/ja/conformance.ja.html +118 -0
  51. data/redist/xmlscan/doc/ja/conformance.ja.rd +134 -0
  52. data/redist/xmlscan/doc/ja/manual.ja.html +325 -0
  53. data/redist/xmlscan/doc/ja/manual.ja.rd +370 -0
  54. data/redist/xmlscan/doc/src/Makefile +41 -0
  55. data/redist/xmlscan/doc/src/conformance.rd.src +256 -0
  56. data/redist/xmlscan/doc/src/langsplit.rb +110 -0
  57. data/redist/xmlscan/doc/src/manual.rd.src +614 -0
  58. data/redist/xmlscan/install.rb +41 -0
  59. data/redist/xmlscan/lib/xmlscan/encoding.rb +311 -0
  60. data/redist/xmlscan/lib/xmlscan/htmlscan.rb +289 -0
  61. data/redist/xmlscan/lib/xmlscan/namespace.rb +352 -0
  62. data/redist/xmlscan/lib/xmlscan/parser.rb +299 -0
  63. data/redist/xmlscan/lib/xmlscan/scanner.rb +1109 -0
  64. data/redist/xmlscan/lib/xmlscan/version.rb +22 -0
  65. data/redist/xmlscan/lib/xmlscan/visitor.rb +158 -0
  66. data/redist/xmlscan/lib/xmlscan/xmlchar.rb +441 -0
  67. data/redist/xmlscan/memo/CONFORMANCE +1249 -0
  68. data/redist/xmlscan/memo/PRODUCTIONS +195 -0
  69. data/redist/xmlscan/memo/contentspec.ry +335 -0
  70. data/redist/xmlscan/samples/chibixml.rb +105 -0
  71. data/redist/xmlscan/samples/getxmlchar.rb +122 -0
  72. data/redist/xmlscan/samples/rexml.rb +159 -0
  73. data/redist/xmlscan/samples/xmlbench.rb +88 -0
  74. data/redist/xmlscan/samples/xmlbench/parser/chibixml.rb +22 -0
  75. data/redist/xmlscan/samples/xmlbench/parser/nqxml.rb +29 -0
  76. data/redist/xmlscan/samples/xmlbench/parser/rexml.rb +62 -0
  77. data/redist/xmlscan/samples/xmlbench/parser/xmlparser.rb +22 -0
  78. data/redist/xmlscan/samples/xmlbench/parser/xmlscan-0.0.10.rb +62 -0
  79. data/redist/xmlscan/samples/xmlbench/parser/xmlscan-chibixml.rb +22 -0
  80. data/redist/xmlscan/samples/xmlbench/parser/xmlscan-rexml.rb +22 -0
  81. data/redist/xmlscan/samples/xmlbench/parser/xmlscan.rb +99 -0
  82. data/redist/xmlscan/samples/xmlbench/xmlbench-lib.rb +116 -0
  83. data/redist/xmlscan/samples/xmlconftest.rb +200 -0
  84. data/redist/xmlscan/test.rb +7 -0
  85. data/redist/xmlscan/tests/deftestcase.rb +73 -0
  86. data/redist/xmlscan/tests/runtest.rb +47 -0
  87. data/redist/xmlscan/tests/testall.rb +14 -0
  88. data/redist/xmlscan/tests/testencoding.rb +438 -0
  89. data/redist/xmlscan/tests/testhtmlscan.rb +752 -0
  90. data/redist/xmlscan/tests/testnamespace.rb +457 -0
  91. data/redist/xmlscan/tests/testparser.rb +591 -0
  92. data/redist/xmlscan/tests/testscanner.rb +1749 -0
  93. data/redist/xmlscan/tests/testxmlchar.rb +143 -0
  94. data/redist/xmlscan/tests/visitor.rb +34 -0
  95. data/test/array_extensions_test.rb +2 -2
  96. data/test/ea_instantiator_test.rb +41 -0
  97. data/test/ecore_self_test.rb +53 -0
  98. data/test/environment_test.rb +11 -6
  99. data/test/metamodel_builder_test.rb +404 -245
  100. data/test/metamodel_roundtrip_test.rb +52 -0
  101. data/test/metamodel_roundtrip_test/TestModel.rb +65 -0
  102. data/test/metamodel_roundtrip_test/TestModel_Regenerated.rb +64 -0
  103. data/test/metamodel_roundtrip_test/houseMetamodel.ecore +32 -0
  104. data/test/metamodel_roundtrip_test/houseMetamodel_from_ecore.rb +39 -0
  105. data/test/rgen_test.rb +3 -3
  106. data/test/template_language_test.rb +65 -39
  107. data/test/template_language_test/expected_result.txt +24 -3
  108. data/test/template_language_test/templates/code/array.tpl +11 -0
  109. data/test/template_language_test/templates/content/author.tpl +7 -0
  110. data/test/template_language_test/templates/content/chapter.tpl +1 -1
  111. data/test/template_language_test/templates/root.tpl +17 -8
  112. data/test/template_language_test/testout.txt +24 -3
  113. data/test/testmodel/class_model_checker.rb +119 -0
  114. data/test/{xmi_instantiator_test/testmodel.eap → testmodel/ea_testmodel.eap} +0 -0
  115. data/test/{xmi_instantiator_test/testmodel.xml → testmodel/ea_testmodel.xml} +81 -14
  116. data/test/testmodel/ea_testmodel_partial.xml +317 -0
  117. data/test/testmodel/ecore_model_checker.rb +101 -0
  118. data/test/testmodel/manual_testmodel.xml +22 -0
  119. data/test/testmodel/object_model_checker.rb +67 -0
  120. data/test/transformer_test.rb +18 -10
  121. data/test/xml_instantiator_test.rb +81 -8
  122. data/test/xml_instantiator_test/simple_ecore_model_checker.rb +94 -0
  123. data/test/xml_instantiator_test/simple_xmi_ecore_instantiator.rb +53 -0
  124. data/test/xml_instantiator_test/simple_xmi_metamodel.rb +49 -0
  125. data/test/xml_instantiator_test/simple_xmi_to_ecore.rb +75 -0
  126. metadata +126 -28
  127. data/lib/ea/xmi_class_instantiator.rb +0 -46
  128. data/lib/ea/xmi_helper.rb +0 -26
  129. data/lib/ea/xmi_metamodel.rb +0 -34
  130. data/lib/ea/xmi_object_instantiator.rb +0 -46
  131. data/lib/ea/xmi_to_classmodel.rb +0 -78
  132. data/lib/ea/xmi_to_objectmodel.rb +0 -92
  133. data/lib/mmgen/mm_ext/uml_classmodel_ext.rb +0 -71
  134. data/lib/mmgen/templates/uml_classmodel.tpl +0 -63
  135. data/lib/rgen/xml_instantiator.rb +0 -132
  136. data/lib/uml/objectmodel_instantiator.rb +0 -53
  137. data/lib/uml/uml_classmodel.rb +0 -92
  138. data/lib/uml/uml_objectmodel.rb +0 -65
  139. data/test/metamodel_generator_test.rb +0 -44
  140. data/test/metamodel_generator_test/TestModel.rb +0 -40
  141. data/test/metamodel_generator_test/expected_result.txt +0 -40
  142. data/test/xmi_class_instantiator_test.rb +0 -24
  143. data/test/xmi_instantiator_test/class_model_checker.rb +0 -97
  144. data/test/xmi_object_instantiator_test.rb +0 -65
  145. data/test/xml_instantiator_test/testmodel.xml +0 -7
@@ -0,0 +1,34 @@
1
+ xmlscan
2
+ =======
3
+
4
+ The fastest XML parser written in 100% pure Ruby.
5
+
6
+ Installation
7
+ ------------
8
+
9
+ Run install.rb. Type as follows:
10
+
11
+ $ ruby install.rb
12
+
13
+ Samples
14
+ -------
15
+
16
+ In directory `samples', there are sample programs.
17
+
18
+ LICENCE
19
+ -------
20
+
21
+ This module's license is the same of Ruby. You can redistribute
22
+ it and/or modify it under the same term as Ruby.
23
+
24
+ Japanese: http://www.ruby-lang.org/ja/LICENSE.txt
25
+ English: http://www.ruby-lang.org/en/LICENSE.txt
26
+
27
+ Bug Reports
28
+ -----------
29
+
30
+ Any kinds of comments and bug reports are welcome.
31
+ If you find bugs, please email me.
32
+
33
+
34
+ UENO Katsuhiro <katsu@blue.sky.or.jp>
@@ -0,0 +1,11 @@
1
+ $Id: THANKS,v 1.5 2003/02/15 13:21:39 katsu Exp $
2
+
3
+ Thanks to all of the following for their valuable hints, fixes,
4
+ discussions, and contributions:
5
+
6
+ Yoshida Masato <yoshidam@yoshidam.net>
7
+ TAKAHASHI Masayoshi <maki@inac.co.jp>
8
+ NAKAMURA, Hiroshi <nakahiro@sarion.co.jp>
9
+ James Britt <james@jamesbritt.com>
10
+ Takaaki Tateishi <ttate@kt.jaist.ac.jp>
11
+ Tanaka Akira <akr@m17n.org>
@@ -0,0 +1,74 @@
1
+ <?xml version="1.0" ?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+ <html xmlns="http://www.w3.org/1999/xhtml">
6
+ <head>
7
+ <title>changes.rd</title>
8
+ </head>
9
+ <body>
10
+ <h1><a name="label-0" id="label-0">Changes of xmlscan</a></h1><!-- RDLabel: "Changes of xmlscan" -->
11
+ <h2><a name="label-1" id="label-1">0.3 series</a></h2><!-- RDLabel: "0.3 series" -->
12
+ <h3><a name="label-2" id="label-2">0.3.0</a></h3><!-- RDLabel: "0.3.0" -->
13
+ <ul>
14
+ <li>The head of development.</li>
15
+ </ul>
16
+ <h2><a name="label-3" id="label-3">0.2 series</a></h2><!-- RDLabel: "0.2 series" -->
17
+ <h3><a name="label-4" id="label-4">0.2.1 - Jan 23, 2003</a></h3><!-- RDLabel: "0.2.1 - Jan 23, 2003" -->
18
+ <ul>
19
+ <li>Independented from $KCODE. XMLScanner#kcode and XMLScanner#kcode= were
20
+ added.</li>
21
+ <li>XMLScan::XMLParser doesn't replace any entity references.
22
+ XMLScan::XMLParser::PredefinedEntity was removed.</li>
23
+ <li>XMLScan::XMLParser doesn't exchange any method calls. The following
24
+ methods were never called in xmlscan-0.1, but are called in xmlscan-0.2.
25
+ <ul>
26
+ <li>XMLScan::Visitor#on_charref_hex</li>
27
+ <li>XMLScan::Visitor#on_attr_charref_hex</li>
28
+ <li>XMLScan::Visitor#on_stag_end_empty</li>
29
+ </ul></li>
30
+ <li>XMLScan::XMLChar now uses regular expressions to search illegal
31
+ characters in an XML document. The parsing speed of XMLScan::XMLParser
32
+ with :strict_char option was dramatically improved.</li>
33
+ <li>Fixed a few bugs in XMLScan::XMLScanner.</li>
34
+ <li>Improved parsing speed.</li>
35
+ <li>Ready for Ruby-1.8.</li>
36
+ </ul>
37
+ <h2><a name="label-5" id="label-5">0.1 series</a></h2><!-- RDLabel: "0.1 series" -->
38
+ <h3><a name="label-6" id="label-6">0.1.3 - Jan 10, 2003</a></h3><!-- RDLabel: "0.1.3 - Jan 10, 2003" -->
39
+ <ul>
40
+ <li>Added install.rb, which is an simple installer.</li>
41
+ <li>Fixed a couple of bugs.</li>
42
+ <li>Improved parsing speed.</li>
43
+ <li>Rewrote sample benchmark script.</li>
44
+ </ul>
45
+ <h3><a name="label-7" id="label-7">0.1.2 - Dec 20, 2002</a></h3><!-- RDLabel: "0.1.2 - Dec 20, 2002" -->
46
+ <ul>
47
+ <li>Fixed several bugs in XMLScan::XMLScanner.</li>
48
+ <li>XMLScan::Visitor was moved from scanner.rb to visitor.rb.</li>
49
+ <li>XMLScan::Version was renamed to XMLScan::VERSION.</li>
50
+ <li>Added new constant XMLScan::RELEASE_DATE.</li>
51
+ </ul>
52
+ <h3><a name="label-8" id="label-8">0.1.1 - Oct 10, 2002</a></h3><!-- RDLabel: "0.1.1 - Oct 10, 2002" -->
53
+ <ul>
54
+ <li>The first stable version of xmlscan.</li>
55
+ </ul>
56
+ <h3><a name="label-9" id="label-9">0.1.0rc2 - Sep 30, 2002</a></h3><!-- RDLabel: "0.1.0rc2 - Sep 30, 2002" -->
57
+ <ul>
58
+ <li>Another release candidate.</li>
59
+ </ul>
60
+ <h3><a name="label-10" id="label-10">0.1.0rc1 - Sep 28, 2002</a></h3><!-- RDLabel: "0.1.0rc1 - Sep 28, 2002" -->
61
+ <ul>
62
+ <li>An release candidate for the stable release.</li>
63
+ </ul>
64
+ <h3><a name="label-11" id="label-11">0.1.0-20020920 - Sep 20, 2000</a></h3><!-- RDLabel: "0.1.0-20020920 - Sep 20, 2000" -->
65
+ <ul>
66
+ <li>Restarted the project, and this is the first announced version of
67
+ new xmlscan.</li>
68
+ </ul>
69
+ <h2><a name="label-12" id="label-12">0.0 series</a></h2><!-- RDLabel: "0.0 series" -->
70
+ <p>All versions before 0.1.0-20020920 are called as ``ancient xmlscan'',
71
+ since they are so old that even the author have forgotten what they are ;p</p>
72
+
73
+ </body>
74
+ </html>
@@ -0,0 +1,80 @@
1
+ =begin
2
+ # $Id: changes.rd,v 1.3 2003/01/22 17:02:25 katsu Exp $
3
+
4
+ = Changes of xmlscan
5
+
6
+ == 0.3 series
7
+
8
+ === 0.3.0
9
+
10
+ * The head of development.
11
+
12
+
13
+ == 0.2 series
14
+
15
+ === 0.2.1 - Jan 23, 2003
16
+
17
+ * Independented from $KCODE. XMLScanner#kcode and XMLScanner#kcode= were
18
+ added.
19
+
20
+ * XMLScan::XMLParser doesn't replace any entity references.
21
+ XMLScan::XMLParser::PredefinedEntity was removed.
22
+
23
+ * XMLScan::XMLParser doesn't exchange any method calls. The following
24
+ methods were never called in xmlscan-0.1, but are called in xmlscan-0.2.
25
+ * XMLScan::Visitor#on_charref_hex
26
+ * XMLScan::Visitor#on_attr_charref_hex
27
+ * XMLScan::Visitor#on_stag_end_empty
28
+
29
+ * XMLScan::XMLChar now uses regular expressions to search illegal
30
+ characters in an XML document. The parsing speed of XMLScan::XMLParser
31
+ with :strict_char option was dramatically improved.
32
+
33
+ * Fixed a few bugs in XMLScan::XMLScanner.
34
+
35
+ * Improved parsing speed.
36
+
37
+ * Ready for Ruby-1.8.
38
+
39
+
40
+ == 0.1 series
41
+
42
+ === 0.1.3 - Jan 10, 2003
43
+
44
+ * Added install.rb, which is an simple installer.
45
+ * Fixed a couple of bugs.
46
+ * Improved parsing speed.
47
+ * Rewrote sample benchmark script.
48
+
49
+ === 0.1.2 - Dec 20, 2002
50
+
51
+ * Fixed several bugs in XMLScan::XMLScanner.
52
+ * XMLScan::Visitor was moved from scanner.rb to visitor.rb.
53
+ * XMLScan::Version was renamed to XMLScan::VERSION.
54
+ * Added new constant XMLScan::RELEASE_DATE.
55
+
56
+ === 0.1.1 - Oct 10, 2002
57
+
58
+ * The first stable version of xmlscan.
59
+
60
+ === 0.1.0rc2 - Sep 30, 2002
61
+
62
+ * Another release candidate.
63
+
64
+ === 0.1.0rc1 - Sep 28, 2002
65
+
66
+ * An release candidate for the stable release.
67
+
68
+ === 0.1.0-20020920 - Sep 20, 2000
69
+
70
+ * Restarted the project, and this is the first announced version of
71
+ new xmlscan.
72
+
73
+
74
+ == 0.0 series
75
+
76
+ All versions before 0.1.0-20020920 are called as ``ancient xmlscan'',
77
+ since they are so old that even the author have forgotten what they are ;p
78
+
79
+
80
+ =end
@@ -0,0 +1,136 @@
1
+ <?xml version="1.0" ?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+ <html xmlns="http://www.w3.org/1999/xhtml">
6
+ <head>
7
+ <title>en/conformance.rd</title>
8
+ </head>
9
+ <body>
10
+ <h1><a name="label-0" id="label-0">Conformance of xmlscan to the specifications</a></h1><!-- RDLabel: "Conformance of xmlscan to the specifications" -->
11
+ <p>This document describes the conformance of each parser
12
+ included in xmlscan for XML related specifications.</p>
13
+ <h2><a name="label-1" id="label-1">Abstract</a></h2><!-- RDLabel: "Abstract" -->
14
+ <p>XMLscan is one of "non-validating XML processor" according to
15
+ XML 1.0 Specification <a href="#label-6">[XML]</a>. XMLscan is satisfied with
16
+ almost conditions required for a non-validation XML processor,
17
+ though, for the limitations of implementations, there are mainly
18
+ the following restrictions. For detail, See the below
19
+ descriptions for each class.</p>
20
+ <ul>
21
+ <li>It is impossible to parse an XML document encoded in UTF-16
22
+ directly.</li>
23
+ <li>By default, it is not checked for illegal characters which
24
+ must not appear in an XML document or in a context.</li>
25
+ <li>XMLscan doesn't read any external entities. Well-formedness
26
+ constraints for external entities are not checked.</li>
27
+ <li>XMLscan skips an internal DTD subset. (it will be supported
28
+ in future version). Well-formedness constraints for an
29
+ internal DTD subset are not checked.</li>
30
+ </ul>
31
+ <h2><a name="label-2" id="label-2">Conformance of XMLScan::XMLScanner</a></h2><!-- RDLabel: "Conformance of XMLScan::XMLScanner" -->
32
+ <p>XMLScan::XMLScanner tokenize an XML document and only recognize
33
+ each XML declaration, document type declaration, processing
34
+ instruction, comment, start tag, end tag, empty element tag,
35
+ CDATA section, general entity reference, and character reference.
36
+ It is NOT an error even that one of these parts appears in the
37
+ context which prohibits existence of it, except in the case
38
+ described below.</p>
39
+ <p>It is reported as an parse error that an XML declaration,
40
+ document type definition (except internal DTD subset),
41
+ processing instruction, comment, start tag, end tag, empty
42
+ element tag, CDATA section, general entity reference, or a
43
+ character reference is not matched with its production defined
44
+ in XML 1.0 Specification <a href="#label-6">[XML]</a>.</p>
45
+ <p>For reasonably speed, if `strict_char' option is not specified,
46
+ XMLScan::XMLScanner doesn't check whether a name or character
47
+ data includes an illegal characters for it. All characters
48
+ except ones recognized as one of delimiters in that context
49
+ are allowed. To be more precise, without `strict_char' option,
50
+ the production Char[2], Name[5], Nmtoken[7], EntityValue[9],
51
+ AttValue[10], SystemLiteral[11], PubidChar[13], CharData[14],
52
+ VersionNum[26], and EncName[81] are not checked strictly.</p>
53
+ <p>XMLScan::XMLScanner doesn't normalize linebreaks.</p>
54
+ <p>Since Ruby is not supported UTF-16, it is impossible to parse
55
+ an XML document encoded in UTF-16 as it is. You need to convert
56
+ it to UTF-8 before parsing.</p>
57
+ <p>`&lt;?xml' in a place except the beginning of an XML document is
58
+ regarded as a processing instruction.</p>
59
+ <p>It is not checked whether the value of a standalone document
60
+ documentation is either "yes" or "no".</p>
61
+ <p>It is not checked whether a target in a processing instruction
62
+ is not "xml" or like, which is a reserved target.</p>
63
+ <p>It is reported as a parse error in the case that a document type
64
+ declaration appears in a place except prolog, or two or more
65
+ document type declarations are found in one document.</p>
66
+ <p>It is reported as a well-formedness constraint violation
67
+ that `&lt;' appears directly in a attribute value. If strict_char
68
+ option is specified, XMLScan::XMLScanner checks
69
+ well-formedness constraint: Legal Character.
70
+ Any other well-formedness constraints are not checked.</p>
71
+ <p>XMLScan::XMLScanner skips an internal DTD subset.</p>
72
+ <h2><a name="label-3" id="label-3">Conformance of XMLScan::XMLParser</a></h2><!-- RDLabel: "Conformance of XMLScan::XMLParser" -->
73
+ <p>The goal of XMLScan::XMLParser is to satisfy almost all
74
+ conditions required to a non-validating XML parser.</p>
75
+ <p>The description for XMLScan::XMLScanner about `strict_char'
76
+ option and the description for UTF-16 are applicable to
77
+ XMLScan::XMLParser. The following well-formedness constraints
78
+ about a character reference are checked only if `strict_char'
79
+ option is specified;</p>
80
+ <ul>
81
+ <li>Well-formedness constraint: Legal Character</li>
82
+ </ul>
83
+ <p>XMLScan::XMLScanner doesn't normalize linebreaks.</p>
84
+ <p>XMLScan::XMLParser skips an internal DTD subset. The following
85
+ well-formedness constraints about an internal DTD subset are
86
+ not checked;</p>
87
+ <ul>
88
+ <li>Well-formedness constraint: PEs in Internal Subset</li>
89
+ <li>Well-formedness constraint: PE Between Declarations</li>
90
+ <li>Well-formedness constraint: No External Entity References</li>
91
+ <li>Well-formedness constraint: Entity Declared</li>
92
+ <li>Well-formedness constraint: Parsed Entity</li>
93
+ <li>Well-formedness constraint: No Recursion</li>
94
+ <li>Well-formedness constraint: In DTD</li>
95
+ </ul>
96
+ <p>All general entity references except ones to predefined entities
97
+ (lt,gt,amp,quot,apos) are reported as ones to undeclared entities.</p>
98
+ <p>External DTD subsets are not read. The following well-formedness
99
+ constraints about an external DTD subset are not checked;</p>
100
+ <ul>
101
+ <li>Well-formedness constraint: External Subset</li>
102
+ </ul>
103
+ <p>Since XMLScan::XMLParser cannot check whether a replacement text
104
+ of an undeclared entity includes `&lt;', the following
105
+ well-formedness constraints are not checked completely;</p>
106
+ <ul>
107
+ <li>Well-formedness constraint: No &lt; in Attribute Values</li>
108
+ </ul>
109
+ <h2><a name="label-4" id="label-4">Conformance of XMLScan::XMLNamespace</a></h2><!-- RDLabel: "Conformance of XMLScan::XMLNamespace" -->
110
+ <p>XMLScan::XMLNamespace checks for all constraints specified in
111
+ ``Namespaces in XML'' and its errata <a href="#label-7">[Namespaces]</a>, and
112
+ ensure that an XML document is namespace-well-formed.</p>
113
+ <p>All limitations for XMLScan::XMLParser are inherited to
114
+ XMLScan::XMLNamespace.</p>
115
+ <h2><a name="label-5" id="label-5">References</a></h2><!-- RDLabel: "References" -->
116
+ <dl>
117
+ <dt><a name="label-6" id="label-6">[XML]</a></dt><!-- RDLabel: "[XML]" -->
118
+ <dd>
119
+ W3C (World Wide Web Consortium).
120
+ Extensible Markup Language (XML) 1.0 (Second Edition),
121
+ January 2000.
122
+ <a href="http://www.w3.org/TR/2000/REC-xml-20001006">&lt;URL:http://www.w3.org/TR/2000/REC-xml-20001006&gt;</a>
123
+ </dd>
124
+ <dt><a name="label-7" id="label-7">[Namespaces]</a></dt><!-- RDLabel: "[Namespaces]" -->
125
+ <dd>
126
+ W3C (World Wide Web Consortium).
127
+ Namespaces in XML,
128
+ January 1999.
129
+ <a href="http://www.w3.org/TR/1999/REC-xml-names-19990114">&lt;URL:http://www.w3.org/TR/1999/REC-xml-names-19990114&gt;</a>.
130
+ Important corrections are found at
131
+ <a href="http://www.w3.org/XML/xml-names-19990114-errata">&lt;URL:http://www.w3.org/XML/xml-names-19990114-errata&gt;</a>.
132
+ </dd>
133
+ </dl>
134
+
135
+ </body>
136
+ </html>
@@ -0,0 +1,152 @@
1
+ =begin
2
+ # $Id: conformance.rd.src,v 1.1 2003/01/22 16:41:45 katsu Exp $
3
+
4
+ = Conformance of xmlscan to the specifications
5
+
6
+ This document describes the conformance of each parser
7
+ included in xmlscan for XML related specifications.
8
+
9
+ == Abstract
10
+
11
+ XMLscan is one of "non-validating XML processor" according to
12
+ XML 1.0 Specification ((<[XML]>)). XMLscan is satisfied with
13
+ almost conditions required for a non-validation XML processor,
14
+ though, for the limitations of implementations, there are mainly
15
+ the following restrictions. For detail, See the below
16
+ descriptions for each class.
17
+
18
+ * It is impossible to parse an XML document encoded in UTF-16
19
+ directly.
20
+ * By default, it is not checked for illegal characters which
21
+ must not appear in an XML document or in a context.
22
+ * XMLscan doesn't read any external entities. Well-formedness
23
+ constraints for external entities are not checked.
24
+ * XMLscan skips an internal DTD subset. (it will be supported
25
+ in future version). Well-formedness constraints for an
26
+ internal DTD subset are not checked.
27
+
28
+
29
+ == Conformance of XMLScan::XMLScanner
30
+
31
+ XMLScan::XMLScanner tokenize an XML document and only recognize
32
+ each XML declaration, document type declaration, processing
33
+ instruction, comment, start tag, end tag, empty element tag,
34
+ CDATA section, general entity reference, and character reference.
35
+ It is NOT an error even that one of these parts appears in the
36
+ context which prohibits existence of it, except in the case
37
+ described below.
38
+
39
+ It is reported as an parse error that an XML declaration,
40
+ document type definition (except internal DTD subset),
41
+ processing instruction, comment, start tag, end tag, empty
42
+ element tag, CDATA section, general entity reference, or a
43
+ character reference is not matched with its production defined
44
+ in XML 1.0 Specification ((<[XML]>)).
45
+
46
+ For reasonably speed, if `strict_char' option is not specified,
47
+ XMLScan::XMLScanner doesn't check whether a name or character
48
+ data includes an illegal characters for it. All characters
49
+ except ones recognized as one of delimiters in that context
50
+ are allowed. To be more precise, without `strict_char' option,
51
+ the production Char[2], Name[5], Nmtoken[7], EntityValue[9],
52
+ AttValue[10], SystemLiteral[11], PubidChar[13], CharData[14],
53
+ VersionNum[26], and EncName[81] are not checked strictly.
54
+
55
+ XMLScan::XMLScanner doesn't normalize linebreaks.
56
+
57
+ Since Ruby is not supported UTF-16, it is impossible to parse
58
+ an XML document encoded in UTF-16 as it is. You need to convert
59
+ it to UTF-8 before parsing.
60
+
61
+ `<?xml' in a place except the beginning of an XML document is
62
+ regarded as a processing instruction.
63
+
64
+ It is not checked whether the value of a standalone document
65
+ documentation is either "yes" or "no".
66
+
67
+ It is not checked whether a target in a processing instruction
68
+ is not "xml" or like, which is a reserved target.
69
+
70
+ It is reported as a parse error in the case that a document type
71
+ declaration appears in a place except prolog, or two or more
72
+ document type declarations are found in one document.
73
+
74
+ It is reported as a well-formedness constraint violation
75
+ that `<' appears directly in a attribute value. If strict_char
76
+ option is specified, XMLScan::XMLScanner checks
77
+ well-formedness constraint: Legal Character.
78
+ Any other well-formedness constraints are not checked.
79
+
80
+ XMLScan::XMLScanner skips an internal DTD subset.
81
+
82
+
83
+ == Conformance of XMLScan::XMLParser
84
+
85
+ The goal of XMLScan::XMLParser is to satisfy almost all
86
+ conditions required to a non-validating XML parser.
87
+
88
+ The description for XMLScan::XMLScanner about `strict_char'
89
+ option and the description for UTF-16 are applicable to
90
+ XMLScan::XMLParser. The following well-formedness constraints
91
+ about a character reference are checked only if `strict_char'
92
+ option is specified;
93
+
94
+ * Well-formedness constraint: Legal Character
95
+
96
+ XMLScan::XMLScanner doesn't normalize linebreaks.
97
+
98
+ XMLScan::XMLParser skips an internal DTD subset. The following
99
+ well-formedness constraints about an internal DTD subset are
100
+ not checked;
101
+
102
+ * Well-formedness constraint: PEs in Internal Subset
103
+ * Well-formedness constraint: PE Between Declarations
104
+ * Well-formedness constraint: No External Entity References
105
+ * Well-formedness constraint: Entity Declared
106
+ * Well-formedness constraint: Parsed Entity
107
+ * Well-formedness constraint: No Recursion
108
+ * Well-formedness constraint: In DTD
109
+
110
+ All general entity references except ones to predefined entities
111
+ (lt,gt,amp,quot,apos) are reported as ones to undeclared entities.
112
+
113
+ External DTD subsets are not read. The following well-formedness
114
+ constraints about an external DTD subset are not checked;
115
+
116
+ * Well-formedness constraint: External Subset
117
+
118
+ Since XMLScan::XMLParser cannot check whether a replacement text
119
+ of an undeclared entity includes `<', the following
120
+ well-formedness constraints are not checked completely;
121
+
122
+ * Well-formedness constraint: No < in Attribute Values
123
+
124
+
125
+ == Conformance of XMLScan::XMLNamespace
126
+
127
+ XMLScan::XMLNamespace checks for all constraints specified in
128
+ ``Namespaces in XML'' and its errata ((<[Namespaces]>)), and
129
+ ensure that an XML document is namespace-well-formed.
130
+
131
+ All limitations for XMLScan::XMLParser are inherited to
132
+ XMLScan::XMLNamespace.
133
+
134
+
135
+ == References
136
+
137
+ : [XML]
138
+ W3C (World Wide Web Consortium).
139
+ Extensible Markup Language (XML) 1.0 (Second Edition),
140
+ January 2000.
141
+ ((<URL:http://www.w3.org/TR/2000/REC-xml-20001006>))
142
+
143
+ : [Namespaces]
144
+ W3C (World Wide Web Consortium).
145
+ Namespaces in XML,
146
+ January 1999.
147
+ ((<URL:http://www.w3.org/TR/1999/REC-xml-names-19990114>)).
148
+ Important corrections are found at
149
+ ((<URL:http://www.w3.org/XML/xml-names-19990114-errata>)).
150
+
151
+
152
+ =end