libxml-ruby 2.7.0 → 2.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +6 -14
  2. data/HISTORY +33 -11
  3. data/README.rdoc +7 -7
  4. data/Rakefile +80 -77
  5. data/ext/libxml/extconf.h +4 -5
  6. data/ext/libxml/extconf.rb +57 -118
  7. data/ext/libxml/libxml.c +4 -0
  8. data/ext/libxml/ruby_xml.c +977 -893
  9. data/ext/libxml/ruby_xml.h +20 -10
  10. data/ext/libxml/ruby_xml_attr.c +333 -333
  11. data/ext/libxml/ruby_xml_attr_decl.c +2 -2
  12. data/ext/libxml/ruby_xml_cbg.c +85 -85
  13. data/ext/libxml/ruby_xml_document.c +1133 -1147
  14. data/ext/libxml/ruby_xml_dtd.c +261 -268
  15. data/ext/libxml/ruby_xml_encoding.c +262 -260
  16. data/ext/libxml/ruby_xml_encoding.h +19 -19
  17. data/ext/libxml/ruby_xml_html_parser_context.c +337 -338
  18. data/ext/libxml/ruby_xml_input_cbg.c +191 -191
  19. data/ext/libxml/ruby_xml_io.c +52 -50
  20. data/ext/libxml/ruby_xml_namespace.c +2 -2
  21. data/ext/libxml/ruby_xml_node.c +1446 -1452
  22. data/ext/libxml/ruby_xml_parser_context.c +999 -1001
  23. data/ext/libxml/ruby_xml_reader.c +1226 -1228
  24. data/ext/libxml/ruby_xml_relaxng.c +110 -111
  25. data/ext/libxml/ruby_xml_sax2_handler.c +326 -328
  26. data/ext/libxml/ruby_xml_schema.c +300 -301
  27. data/ext/libxml/ruby_xml_version.h +3 -3
  28. data/ext/libxml/ruby_xml_writer.c +34 -16
  29. data/ext/libxml/ruby_xml_xpath.c +188 -187
  30. data/ext/libxml/ruby_xml_xpath_context.c +360 -361
  31. data/ext/libxml/ruby_xml_xpath_object.c +335 -335
  32. data/libxml-ruby.gemspec +47 -44
  33. data/test/tc_attr.rb +5 -7
  34. data/test/tc_attr_decl.rb +5 -6
  35. data/test/tc_attributes.rb +1 -2
  36. data/test/tc_canonicalize.rb +1 -2
  37. data/test/tc_deprecated_require.rb +1 -2
  38. data/test/tc_document.rb +4 -5
  39. data/test/tc_document_write.rb +2 -3
  40. data/test/tc_dtd.rb +4 -5
  41. data/test/tc_encoding.rb +126 -126
  42. data/test/tc_encoding_sax.rb +4 -3
  43. data/test/tc_error.rb +14 -15
  44. data/test/tc_html_parser.rb +15 -7
  45. data/test/tc_html_parser_context.rb +1 -2
  46. data/test/tc_namespace.rb +2 -3
  47. data/test/tc_namespaces.rb +5 -6
  48. data/test/tc_node.rb +2 -3
  49. data/test/tc_node_cdata.rb +2 -3
  50. data/test/tc_node_comment.rb +1 -2
  51. data/test/tc_node_copy.rb +1 -2
  52. data/test/tc_node_edit.rb +5 -7
  53. data/test/tc_node_pi.rb +1 -2
  54. data/test/tc_node_text.rb +2 -3
  55. data/test/tc_node_write.rb +2 -3
  56. data/test/tc_node_xlink.rb +1 -2
  57. data/test/tc_parser.rb +18 -24
  58. data/test/tc_parser_context.rb +6 -7
  59. data/test/tc_properties.rb +1 -2
  60. data/test/tc_reader.rb +9 -10
  61. data/test/tc_relaxng.rb +4 -5
  62. data/test/tc_sax_parser.rb +9 -10
  63. data/test/tc_schema.rb +4 -5
  64. data/test/tc_traversal.rb +1 -2
  65. data/test/tc_writer.rb +1 -2
  66. data/test/tc_xinclude.rb +1 -2
  67. data/test/tc_xml.rb +1 -2
  68. data/test/tc_xpath.rb +8 -9
  69. data/test/tc_xpath_context.rb +3 -4
  70. data/test/tc_xpath_expression.rb +3 -4
  71. data/test/tc_xpointer.rb +1 -3
  72. data/test/test_helper.rb +3 -1
  73. data/test/test_suite.rb +0 -1
  74. metadata +90 -72
  75. data/test/etc_doc_to_s.rb +0 -21
  76. data/test/ets_doc_file.rb +0 -17
  77. data/test/ets_doc_to_s.rb +0 -23
  78. data/test/ets_gpx.rb +0 -28
  79. data/test/ets_node_gc.rb +0 -23
  80. data/test/ets_test.xml +0 -2
  81. data/test/ets_tsr.rb +0 -11
  82. data/test/model/kml_sample.xml +0 -915
  83. data/test/remove_test.rb +0 -9
  84. data/test/tc_gc.rb +0 -86
  85. data/test/tc_parser.rb.orig +0 -384
@@ -1,111 +1,110 @@
1
- #include "ruby_libxml.h"
2
- #include "ruby_xml_relaxng.h"
3
-
4
- /*
5
- * Document-class: LibXML::XML::RelaxNG
6
- *
7
- * The XML::RelaxNG class is used to prepare RelaxNG schemas for validation
8
- * of xml documents.
9
- *
10
- * Schemas can be created from XML documents, strings or URIs using the
11
- * corresponding methods (new for URIs).
12
- *
13
- * Once a schema is prepared, an XML document can be validated by the
14
- * XML::Document#validate_relaxng method providing the XML::RelaxNG object
15
- * as parameter. The method will raise an exception if the document is
16
- * not valid.
17
- *
18
- * Basic Usage:
19
- *
20
- * # parse schema as xml document
21
- * relaxng_document = XML::Document.file('schema.rng')
22
- *
23
- * # prepare schema for validation
24
- * relaxng_schema = XML::RelaxNG.document(relaxng_document)
25
- *
26
- * # parse xml document to be validated
27
- * instance = XML::Document.file('instance.xml')
28
- *
29
- * # validate
30
- * instance.validate_relaxng(relaxng_schema)
31
- */
32
-
33
- VALUE cXMLRelaxNG;
34
-
35
- static void rxml_relaxng_free(xmlRelaxNGPtr xrelaxng)
36
- {
37
- xmlRelaxNGFree(xrelaxng);
38
- }
39
-
40
- /*
41
- * call-seq:
42
- * XML::Relaxng.new(relaxng_uri) -> relaxng
43
- *
44
- * Create a new relaxng from the specified URI.
45
- */
46
- static VALUE rxml_relaxng_init_from_uri(VALUE class, VALUE uri)
47
- {
48
- xmlRelaxNGParserCtxtPtr xparser;
49
- xmlRelaxNGPtr xrelaxng;
50
-
51
- Check_Type(uri, T_STRING);
52
-
53
- xparser = xmlRelaxNGNewParserCtxt(StringValuePtr(uri));
54
- xrelaxng = xmlRelaxNGParse(xparser);
55
- xmlRelaxNGFreeParserCtxt(xparser);
56
-
57
- return Data_Wrap_Struct(cXMLRelaxNG, NULL, rxml_relaxng_free, xrelaxng);
58
- }
59
-
60
- /*
61
- * call-seq:
62
- * XML::RelaxNG.document(document) -> relaxng
63
- *
64
- * Create a new relaxng from the specified document.
65
- */
66
- static VALUE rxml_relaxng_init_from_document(VALUE class, VALUE document)
67
- {
68
- xmlDocPtr xdoc;
69
- xmlRelaxNGPtr xrelaxng;
70
- xmlRelaxNGParserCtxtPtr xparser;
71
-
72
- Data_Get_Struct(document, xmlDoc, xdoc);
73
-
74
- xparser = xmlRelaxNGNewDocParserCtxt(xdoc);
75
- xrelaxng = xmlRelaxNGParse(xparser);
76
- xmlRelaxNGFreeParserCtxt(xparser);
77
-
78
- return Data_Wrap_Struct(cXMLRelaxNG, NULL, rxml_relaxng_free, xrelaxng);
79
- }
80
-
81
- /*
82
- * call-seq:
83
- * XML::RelaxNG.string("relaxng_data") -> "value"
84
- *
85
- * Create a new relaxng using the specified string.
86
- */
87
- static VALUE rxml_relaxng_init_from_string(VALUE self, VALUE relaxng_str)
88
- {
89
- xmlRelaxNGParserCtxtPtr xparser;
90
- xmlRelaxNGPtr xrelaxng;
91
-
92
- Check_Type(relaxng_str, T_STRING);
93
-
94
- xparser = xmlRelaxNGNewMemParserCtxt(StringValuePtr(relaxng_str), strlen(
95
- StringValuePtr(relaxng_str)));
96
- xrelaxng = xmlRelaxNGParse(xparser);
97
- xmlRelaxNGFreeParserCtxt(xparser);
98
-
99
- return Data_Wrap_Struct(cXMLRelaxNG, NULL, rxml_relaxng_free, xrelaxng);
100
- }
101
-
102
- void rxml_init_relaxng(void)
103
- {
104
- cXMLRelaxNG = rb_define_class_under(mXML, "RelaxNG", rb_cObject);
105
- rb_define_singleton_method(cXMLRelaxNG, "new", rxml_relaxng_init_from_uri, 1);
106
- rb_define_singleton_method(cXMLRelaxNG, "from_string",
107
- rxml_relaxng_init_from_string, 1);
108
- rb_define_singleton_method(cXMLRelaxNG, "document",
109
- rxml_relaxng_init_from_document, 1);
110
- }
111
-
1
+ #include "ruby_libxml.h"
2
+ #include "ruby_xml_relaxng.h"
3
+
4
+ /*
5
+ * Document-class: LibXML::XML::RelaxNG
6
+ *
7
+ * The XML::RelaxNG class is used to prepare RelaxNG schemas for validation
8
+ * of xml documents.
9
+ *
10
+ * Schemas can be created from XML documents, strings or URIs using the
11
+ * corresponding methods (new for URIs).
12
+ *
13
+ * Once a schema is prepared, an XML document can be validated by the
14
+ * XML::Document#validate_relaxng method providing the XML::RelaxNG object
15
+ * as parameter. The method will raise an exception if the document is
16
+ * not valid.
17
+ *
18
+ * Basic Usage:
19
+ *
20
+ * # parse schema as xml document
21
+ * relaxng_document = XML::Document.file('schema.rng')
22
+ *
23
+ * # prepare schema for validation
24
+ * relaxng_schema = XML::RelaxNG.document(relaxng_document)
25
+ *
26
+ * # parse xml document to be validated
27
+ * instance = XML::Document.file('instance.xml')
28
+ *
29
+ * # validate
30
+ * instance.validate_relaxng(relaxng_schema)
31
+ */
32
+
33
+ VALUE cXMLRelaxNG;
34
+
35
+ static void rxml_relaxng_free(xmlRelaxNGPtr xrelaxng)
36
+ {
37
+ xmlRelaxNGFree(xrelaxng);
38
+ }
39
+
40
+ /*
41
+ * call-seq:
42
+ * XML::Relaxng.new(relaxng_uri) -> relaxng
43
+ *
44
+ * Create a new relaxng from the specified URI.
45
+ */
46
+ static VALUE rxml_relaxng_init_from_uri(VALUE class, VALUE uri)
47
+ {
48
+ xmlRelaxNGParserCtxtPtr xparser;
49
+ xmlRelaxNGPtr xrelaxng;
50
+
51
+ Check_Type(uri, T_STRING);
52
+
53
+ xparser = xmlRelaxNGNewParserCtxt(StringValuePtr(uri));
54
+ xrelaxng = xmlRelaxNGParse(xparser);
55
+ xmlRelaxNGFreeParserCtxt(xparser);
56
+
57
+ return Data_Wrap_Struct(cXMLRelaxNG, NULL, rxml_relaxng_free, xrelaxng);
58
+ }
59
+
60
+ /*
61
+ * call-seq:
62
+ * XML::RelaxNG.document(document) -> relaxng
63
+ *
64
+ * Create a new relaxng from the specified document.
65
+ */
66
+ static VALUE rxml_relaxng_init_from_document(VALUE class, VALUE document)
67
+ {
68
+ xmlDocPtr xdoc;
69
+ xmlRelaxNGPtr xrelaxng;
70
+ xmlRelaxNGParserCtxtPtr xparser;
71
+
72
+ Data_Get_Struct(document, xmlDoc, xdoc);
73
+
74
+ xparser = xmlRelaxNGNewDocParserCtxt(xdoc);
75
+ xrelaxng = xmlRelaxNGParse(xparser);
76
+ xmlRelaxNGFreeParserCtxt(xparser);
77
+
78
+ return Data_Wrap_Struct(cXMLRelaxNG, NULL, rxml_relaxng_free, xrelaxng);
79
+ }
80
+
81
+ /*
82
+ * call-seq:
83
+ * XML::RelaxNG.string("relaxng_data") -> "value"
84
+ *
85
+ * Create a new relaxng using the specified string.
86
+ */
87
+ static VALUE rxml_relaxng_init_from_string(VALUE self, VALUE relaxng_str)
88
+ {
89
+ xmlRelaxNGParserCtxtPtr xparser;
90
+ xmlRelaxNGPtr xrelaxng;
91
+
92
+ Check_Type(relaxng_str, T_STRING);
93
+
94
+ xparser = xmlRelaxNGNewMemParserCtxt(StringValuePtr(relaxng_str), (int)strlen(StringValuePtr(relaxng_str)));
95
+ xrelaxng = xmlRelaxNGParse(xparser);
96
+ xmlRelaxNGFreeParserCtxt(xparser);
97
+
98
+ return Data_Wrap_Struct(cXMLRelaxNG, NULL, rxml_relaxng_free, xrelaxng);
99
+ }
100
+
101
+ void rxml_init_relaxng(void)
102
+ {
103
+ cXMLRelaxNG = rb_define_class_under(mXML, "RelaxNG", rb_cObject);
104
+ rb_define_singleton_method(cXMLRelaxNG, "new", rxml_relaxng_init_from_uri, 1);
105
+ rb_define_singleton_method(cXMLRelaxNG, "from_string",
106
+ rxml_relaxng_init_from_string, 1);
107
+ rb_define_singleton_method(cXMLRelaxNG, "document",
108
+ rxml_relaxng_init_from_document, 1);
109
+ }
110
+