libxml-ruby 5.0.4 → 5.0.6

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 (97) hide show
  1. checksums.yaml +4 -4
  2. data/HISTORY +17 -6
  3. data/README.rdoc +1 -1
  4. data/Rakefile +98 -98
  5. data/ext/libxml/extconf.h +1 -0
  6. data/ext/libxml/extconf.rb +5 -0
  7. data/ext/libxml/libxml.c +79 -79
  8. data/ext/libxml/ruby_xml.c +556 -556
  9. data/ext/libxml/ruby_xml_attr.c +333 -333
  10. data/ext/libxml/ruby_xml_attr.h +12 -12
  11. data/ext/libxml/ruby_xml_attr_decl.h +11 -11
  12. data/ext/libxml/ruby_xml_attributes.h +17 -17
  13. data/ext/libxml/ruby_xml_cbg.c +85 -85
  14. data/ext/libxml/ruby_xml_document.c +1129 -1129
  15. data/ext/libxml/ruby_xml_dtd.c +257 -257
  16. data/ext/libxml/ruby_xml_dtd.h +9 -9
  17. data/ext/libxml/ruby_xml_encoding.c +250 -250
  18. data/ext/libxml/ruby_xml_error.c +1003 -1003
  19. data/ext/libxml/ruby_xml_error.h +14 -14
  20. data/ext/libxml/ruby_xml_html_parser.c +91 -91
  21. data/ext/libxml/ruby_xml_html_parser.h +10 -10
  22. data/ext/libxml/ruby_xml_html_parser_context.c +351 -351
  23. data/ext/libxml/ruby_xml_html_parser_context.h +10 -10
  24. data/ext/libxml/ruby_xml_html_parser_options.c +48 -48
  25. data/ext/libxml/ruby_xml_html_parser_options.h +10 -10
  26. data/ext/libxml/ruby_xml_input_cbg.c +188 -188
  27. data/ext/libxml/ruby_xml_input_cbg.h +20 -20
  28. data/ext/libxml/ruby_xml_io.c +47 -47
  29. data/ext/libxml/ruby_xml_io.h +10 -10
  30. data/ext/libxml/ruby_xml_namespace.c +151 -151
  31. data/ext/libxml/ruby_xml_namespace.h +10 -10
  32. data/ext/libxml/ruby_xml_namespaces.c +293 -293
  33. data/ext/libxml/ruby_xml_namespaces.h +9 -9
  34. data/ext/libxml/ruby_xml_node.h +13 -13
  35. data/ext/libxml/ruby_xml_parser.c +91 -91
  36. data/ext/libxml/ruby_xml_parser.h +10 -10
  37. data/ext/libxml/ruby_xml_parser_context.c +1009 -1009
  38. data/ext/libxml/ruby_xml_parser_context.h +10 -10
  39. data/ext/libxml/ruby_xml_parser_options.c +74 -74
  40. data/ext/libxml/ruby_xml_parser_options.h +10 -10
  41. data/ext/libxml/ruby_xml_reader.h +14 -14
  42. data/ext/libxml/ruby_xml_relaxng.h +8 -8
  43. data/ext/libxml/ruby_xml_sax2_handler.c +326 -326
  44. data/ext/libxml/ruby_xml_sax2_handler.h +10 -10
  45. data/ext/libxml/ruby_xml_sax_parser.c +108 -108
  46. data/ext/libxml/ruby_xml_sax_parser.h +10 -10
  47. data/ext/libxml/ruby_xml_schema.h +25 -25
  48. data/ext/libxml/ruby_xml_schema_attribute.h +37 -37
  49. data/ext/libxml/ruby_xml_schema_element.h +11 -11
  50. data/ext/libxml/ruby_xml_schema_facet.c +50 -50
  51. data/ext/libxml/ruby_xml_schema_facet.h +9 -9
  52. data/ext/libxml/ruby_xml_schema_type.h +9 -9
  53. data/ext/libxml/ruby_xml_version.h +9 -9
  54. data/ext/libxml/ruby_xml_writer.c +1124 -1124
  55. data/ext/libxml/ruby_xml_writer.h +6 -6
  56. data/ext/libxml/ruby_xml_xinclude.c +20 -20
  57. data/ext/libxml/ruby_xml_xinclude.h +11 -11
  58. data/ext/libxml/ruby_xml_xpath.c +195 -195
  59. data/ext/libxml/ruby_xml_xpath.h +15 -15
  60. data/ext/libxml/ruby_xml_xpath_context.c +362 -362
  61. data/ext/libxml/ruby_xml_xpath_context.h +9 -9
  62. data/ext/libxml/ruby_xml_xpath_expression.h +10 -10
  63. data/ext/libxml/ruby_xml_xpath_object.h +17 -17
  64. data/lib/libxml/attr.rb +122 -122
  65. data/lib/libxml/attr_decl.rb +80 -80
  66. data/lib/libxml/attributes.rb +13 -13
  67. data/lib/libxml/document.rb +194 -194
  68. data/lib/libxml/error.rb +95 -95
  69. data/lib/libxml/hpricot.rb +77 -77
  70. data/lib/libxml/html_parser.rb +96 -96
  71. data/lib/libxml/namespace.rb +61 -61
  72. data/lib/libxml/namespaces.rb +37 -37
  73. data/lib/libxml/node.rb +323 -323
  74. data/lib/libxml/parser.rb +102 -102
  75. data/lib/libxml/sax_callbacks.rb +179 -179
  76. data/lib/libxml/sax_parser.rb +40 -40
  77. data/lib/libxml/tree.rb +28 -28
  78. data/lib/libxml-ruby.rb +2 -2
  79. data/lib/libxml.rb +4 -4
  80. data/lib/xml/libxml.rb +10 -10
  81. data/lib/xml.rb +13 -13
  82. data/libxml-ruby.gemspec +50 -49
  83. data/test/test_document.rb +140 -140
  84. data/test/test_document_write.rb +142 -142
  85. data/test/test_dtd.rb +126 -126
  86. data/test/test_encoding.rb +126 -126
  87. data/test/test_error.rb +197 -194
  88. data/test/test_helper.rb +21 -20
  89. data/test/test_namespace.rb +58 -58
  90. data/test/test_node.rb +235 -235
  91. data/test/test_node_write.rb +93 -93
  92. data/test/test_parser.rb +333 -333
  93. data/test/test_reader.rb +364 -364
  94. data/test/test_writer.rb +500 -468
  95. data/test/test_xml.rb +168 -168
  96. metadata +5 -5
  97. data/test/test.rb +0 -5
@@ -1,14 +1,14 @@
1
- /* Please see the LICENSE file for copyright and distribution information */
2
-
3
- #ifndef __RXML_ERROR__
4
- #define __RXML_ERROR__
5
-
6
- #include <libxml/xmlerror.h>
7
-
8
- extern VALUE eXMLError;
9
-
10
- void rxml_init_error(void);
11
- VALUE rxml_error_wrap(const xmlError *xerror);
12
- void rxml_raise(const xmlError *xerror);
13
-
14
- #endif
1
+ /* Please see the LICENSE file for copyright and distribution information */
2
+
3
+ #ifndef __RXML_ERROR__
4
+ #define __RXML_ERROR__
5
+
6
+ #include <libxml/xmlerror.h>
7
+
8
+ extern VALUE eXMLError;
9
+
10
+ void rxml_init_error(void);
11
+ VALUE rxml_error_wrap(const xmlError *xerror);
12
+ void rxml_raise(const xmlError *xerror);
13
+
14
+ #endif
@@ -1,91 +1,91 @@
1
- /* Please see the LICENSE file for copyright and distribution information */
2
-
3
- #include "ruby_libxml.h"
4
-
5
- #include <libxml/HTMLparser.h>
6
-
7
- /* Document-class: LibXML::XML::HTMLParser
8
- *
9
- * The HTML parser implements an HTML 4.0 non-verifying parser with an API
10
- * compatible with the XML::Parser. In contrast with the XML::Parser,
11
- * it can parse "real world" HTML, even if it severely broken from a
12
- * specification point of view.
13
- *
14
- * The HTML parser creates an in-memory document object
15
- * that consist of any number of XML::Node instances. This is simple
16
- * and powerful model, but has the major limitation that the size of
17
- * the document that can be processed is limited by the amount of
18
- * memory available.
19
- *
20
- * Using the html parser is simple:
21
- *
22
- * parser = XML::HTMLParser.file('my_file')
23
- * doc = parser.parse
24
- *
25
- * You can also parse documents (see XML::HTMLParser.document),
26
- * strings (see XML::HTMLParser.string) and io objects (see
27
- * XML::HTMLParser.io).
28
- */
29
-
30
- VALUE cXMLHtmlParser;
31
- static ID CONTEXT_ATTR;
32
-
33
-
34
- /* call-seq:
35
- * XML::HTMLParser.initialize -> parser
36
- *
37
- * Initializes a new parser instance with no pre-determined source.
38
- */
39
- static VALUE rxml_html_parser_initialize(int argc, VALUE *argv, VALUE self)
40
- {
41
- VALUE context = Qnil;
42
-
43
- rb_scan_args(argc, argv, "01", &context);
44
-
45
- if (context == Qnil)
46
- {
47
- rb_raise(rb_eArgError, "An instance of a XML::Parser::Context must be passed to XML::HTMLParser.new");
48
- }
49
-
50
- rb_ivar_set(self, CONTEXT_ATTR, context);
51
- return self;
52
- }
53
-
54
- /*
55
- * call-seq:
56
- * parser.parse -> XML::Document
57
- *
58
- * Parse the input XML and create an XML::Document with
59
- * it's content. If an error occurs, XML::Parser::ParseError
60
- * is thrown.
61
- */
62
- static VALUE rxml_html_parser_parse(VALUE self)
63
- {
64
- xmlParserCtxtPtr ctxt;
65
- VALUE context = rb_ivar_get(self, CONTEXT_ATTR);
66
-
67
- Data_Get_Struct(context, xmlParserCtxt, ctxt);
68
-
69
- if (htmlParseDocument(ctxt) == -1 && ! ctxt->recovery)
70
- {
71
- rxml_raise(&ctxt->lastError);
72
- }
73
-
74
- rb_funcall(context, rb_intern("close"), 0);
75
-
76
- return rxml_document_wrap(ctxt->myDoc);
77
- }
78
-
79
- void rxml_init_html_parser(void)
80
- {
81
- CONTEXT_ATTR = rb_intern("@context");
82
-
83
- cXMLHtmlParser = rb_define_class_under(mXML, "HTMLParser", rb_cObject);
84
-
85
- /* Atributes */
86
- rb_define_attr(cXMLHtmlParser, "input", 1, 0);
87
-
88
- /* Instance methods */
89
- rb_define_method(cXMLHtmlParser, "initialize", rxml_html_parser_initialize, -1);
90
- rb_define_method(cXMLHtmlParser, "parse", rxml_html_parser_parse, 0);
91
- }
1
+ /* Please see the LICENSE file for copyright and distribution information */
2
+
3
+ #include "ruby_libxml.h"
4
+
5
+ #include <libxml/HTMLparser.h>
6
+
7
+ /* Document-class: LibXML::XML::HTMLParser
8
+ *
9
+ * The HTML parser implements an HTML 4.0 non-verifying parser with an API
10
+ * compatible with the XML::Parser. In contrast with the XML::Parser,
11
+ * it can parse "real world" HTML, even if it severely broken from a
12
+ * specification point of view.
13
+ *
14
+ * The HTML parser creates an in-memory document object
15
+ * that consist of any number of XML::Node instances. This is simple
16
+ * and powerful model, but has the major limitation that the size of
17
+ * the document that can be processed is limited by the amount of
18
+ * memory available.
19
+ *
20
+ * Using the html parser is simple:
21
+ *
22
+ * parser = XML::HTMLParser.file('my_file')
23
+ * doc = parser.parse
24
+ *
25
+ * You can also parse documents (see XML::HTMLParser.document),
26
+ * strings (see XML::HTMLParser.string) and io objects (see
27
+ * XML::HTMLParser.io).
28
+ */
29
+
30
+ VALUE cXMLHtmlParser;
31
+ static ID CONTEXT_ATTR;
32
+
33
+
34
+ /* call-seq:
35
+ * XML::HTMLParser.initialize -> parser
36
+ *
37
+ * Initializes a new parser instance with no pre-determined source.
38
+ */
39
+ static VALUE rxml_html_parser_initialize(int argc, VALUE *argv, VALUE self)
40
+ {
41
+ VALUE context = Qnil;
42
+
43
+ rb_scan_args(argc, argv, "01", &context);
44
+
45
+ if (context == Qnil)
46
+ {
47
+ rb_raise(rb_eArgError, "An instance of a XML::Parser::Context must be passed to XML::HTMLParser.new");
48
+ }
49
+
50
+ rb_ivar_set(self, CONTEXT_ATTR, context);
51
+ return self;
52
+ }
53
+
54
+ /*
55
+ * call-seq:
56
+ * parser.parse -> XML::Document
57
+ *
58
+ * Parse the input XML and create an XML::Document with
59
+ * it's content. If an error occurs, XML::Parser::ParseError
60
+ * is thrown.
61
+ */
62
+ static VALUE rxml_html_parser_parse(VALUE self)
63
+ {
64
+ xmlParserCtxtPtr ctxt;
65
+ VALUE context = rb_ivar_get(self, CONTEXT_ATTR);
66
+
67
+ Data_Get_Struct(context, xmlParserCtxt, ctxt);
68
+
69
+ if (htmlParseDocument(ctxt) == -1 && ! ctxt->recovery)
70
+ {
71
+ rxml_raise(&ctxt->lastError);
72
+ }
73
+
74
+ rb_funcall(context, rb_intern("close"), 0);
75
+
76
+ return rxml_document_wrap(ctxt->myDoc);
77
+ }
78
+
79
+ void rxml_init_html_parser(void)
80
+ {
81
+ CONTEXT_ATTR = rb_intern("@context");
82
+
83
+ cXMLHtmlParser = rb_define_class_under(mXML, "HTMLParser", rb_cObject);
84
+
85
+ /* Atributes */
86
+ rb_define_attr(cXMLHtmlParser, "input", 1, 0);
87
+
88
+ /* Instance methods */
89
+ rb_define_method(cXMLHtmlParser, "initialize", rxml_html_parser_initialize, -1);
90
+ rb_define_method(cXMLHtmlParser, "parse", rxml_html_parser_parse, 0);
91
+ }
@@ -1,10 +1,10 @@
1
- /* Please see the LICENSE file for copyright and distribution information */
2
-
3
- #ifndef __RXML_HTML_PARSER__
4
- #define __RXML_HTML_PARSER__
5
-
6
- extern VALUE cXMLHtmlParser;
7
-
8
- void rxml_init_html_parser(void);
9
-
10
- #endif
1
+ /* Please see the LICENSE file for copyright and distribution information */
2
+
3
+ #ifndef __RXML_HTML_PARSER__
4
+ #define __RXML_HTML_PARSER__
5
+
6
+ extern VALUE cXMLHtmlParser;
7
+
8
+ void rxml_init_html_parser(void);
9
+
10
+ #endif