nokogiri 1.12.4-x86-linux → 1.13.2-x86-linux
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of nokogiri might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Gemfile +2 -0
- data/README.md +9 -7
- data/bin/nokogiri +63 -50
- data/dependencies.yml +11 -62
- data/ext/nokogiri/extconf.rb +64 -37
- data/ext/nokogiri/include/libexslt/exslt.h +6 -0
- data/ext/nokogiri/include/libexslt/exsltconfig.h +1 -1
- data/ext/nokogiri/include/libexslt/exsltexports.h +3 -3
- data/ext/nokogiri/include/libxml2/libxml/xmlerror.h +1 -0
- data/ext/nokogiri/include/libxml2/libxml/xmlversion.h +5 -5
- data/ext/nokogiri/include/libxslt/extensions.h +1 -1
- data/ext/nokogiri/include/libxslt/preproc.h +1 -1
- data/ext/nokogiri/include/libxslt/xsltInternals.h +15 -11
- data/ext/nokogiri/include/libxslt/xsltconfig.h +4 -4
- data/ext/nokogiri/xml_document.c +35 -35
- data/ext/nokogiri/xml_document_fragment.c +0 -2
- data/ext/nokogiri/xml_dtd.c +2 -2
- data/ext/nokogiri/xml_encoding_handler.c +25 -11
- data/ext/nokogiri/xml_node.c +638 -333
- data/ext/nokogiri/xml_reader.c +37 -11
- data/ext/nokogiri/xml_xpath_context.c +72 -49
- data/ext/nokogiri/xslt_stylesheet.c +107 -9
- data/lib/nokogiri/2.6/nokogiri.so +0 -0
- data/lib/nokogiri/2.7/nokogiri.so +0 -0
- data/lib/nokogiri/3.0/nokogiri.so +0 -0
- data/lib/nokogiri/3.1/nokogiri.so +0 -0
- data/lib/nokogiri/class_resolver.rb +67 -0
- data/lib/nokogiri/css/node.rb +9 -8
- data/lib/nokogiri/css/parser.rb +360 -341
- data/lib/nokogiri/css/parser.y +249 -244
- data/lib/nokogiri/css/parser_extras.rb +20 -20
- data/lib/nokogiri/css/syntax_error.rb +1 -0
- data/lib/nokogiri/css/tokenizer.rb +4 -3
- data/lib/nokogiri/css/tokenizer.rex +3 -2
- data/lib/nokogiri/css/xpath_visitor.rb +179 -82
- data/lib/nokogiri/css.rb +38 -6
- data/lib/nokogiri/decorators/slop.rb +8 -7
- data/lib/nokogiri/extension.rb +1 -1
- data/lib/nokogiri/gumbo.rb +1 -0
- data/lib/nokogiri/html.rb +16 -10
- data/lib/nokogiri/html4/builder.rb +1 -0
- data/lib/nokogiri/html4/document.rb +84 -75
- data/lib/nokogiri/html4/document_fragment.rb +11 -7
- data/lib/nokogiri/html4/element_description.rb +1 -0
- data/lib/nokogiri/html4/element_description_defaults.rb +426 -520
- data/lib/nokogiri/html4/entity_lookup.rb +2 -1
- data/lib/nokogiri/html4/sax/parser.rb +2 -1
- data/lib/nokogiri/html4/sax/parser_context.rb +1 -0
- data/lib/nokogiri/html4/sax/push_parser.rb +7 -7
- data/lib/nokogiri/html4.rb +11 -5
- data/lib/nokogiri/html5/document.rb +24 -10
- data/lib/nokogiri/html5/document_fragment.rb +5 -2
- data/lib/nokogiri/html5/node.rb +6 -3
- data/lib/nokogiri/html5.rb +68 -64
- data/lib/nokogiri/jruby/dependencies.rb +10 -9
- data/lib/nokogiri/syntax_error.rb +1 -0
- data/lib/nokogiri/version/constant.rb +2 -1
- data/lib/nokogiri/version/info.rb +19 -13
- data/lib/nokogiri/version.rb +1 -0
- data/lib/nokogiri/xml/attr.rb +5 -3
- data/lib/nokogiri/xml/attribute_decl.rb +2 -1
- data/lib/nokogiri/xml/builder.rb +32 -32
- data/lib/nokogiri/xml/cdata.rb +2 -1
- data/lib/nokogiri/xml/character_data.rb +1 -0
- data/lib/nokogiri/xml/document.rb +139 -103
- data/lib/nokogiri/xml/document_fragment.rb +41 -38
- data/lib/nokogiri/xml/dtd.rb +3 -2
- data/lib/nokogiri/xml/element_content.rb +1 -0
- data/lib/nokogiri/xml/element_decl.rb +2 -1
- data/lib/nokogiri/xml/entity_decl.rb +3 -2
- data/lib/nokogiri/xml/entity_reference.rb +1 -0
- data/lib/nokogiri/xml/namespace.rb +2 -0
- data/lib/nokogiri/xml/node/save_options.rb +7 -4
- data/lib/nokogiri/xml/node.rb +512 -348
- data/lib/nokogiri/xml/node_set.rb +46 -54
- data/lib/nokogiri/xml/notation.rb +12 -0
- data/lib/nokogiri/xml/parse_options.rb +11 -7
- data/lib/nokogiri/xml/pp/character_data.rb +8 -6
- data/lib/nokogiri/xml/pp/node.rb +24 -26
- data/lib/nokogiri/xml/pp.rb +1 -0
- data/lib/nokogiri/xml/processing_instruction.rb +2 -1
- data/lib/nokogiri/xml/reader.rb +17 -19
- data/lib/nokogiri/xml/relax_ng.rb +1 -0
- data/lib/nokogiri/xml/sax/document.rb +20 -19
- data/lib/nokogiri/xml/sax/parser.rb +36 -34
- data/lib/nokogiri/xml/sax/parser_context.rb +7 -3
- data/lib/nokogiri/xml/sax/push_parser.rb +5 -5
- data/lib/nokogiri/xml/sax.rb +1 -0
- data/lib/nokogiri/xml/schema.rb +7 -6
- data/lib/nokogiri/xml/searchable.rb +93 -62
- data/lib/nokogiri/xml/syntax_error.rb +4 -4
- data/lib/nokogiri/xml/text.rb +1 -0
- data/lib/nokogiri/xml/xpath/syntax_error.rb +2 -1
- data/lib/nokogiri/xml/xpath.rb +12 -0
- data/lib/nokogiri/xml/xpath_context.rb +2 -3
- data/lib/nokogiri/xml.rb +3 -3
- data/lib/nokogiri/xslt/stylesheet.rb +1 -0
- data/lib/nokogiri/xslt.rb +21 -13
- data/lib/nokogiri.rb +19 -16
- data/lib/xsd/xmlparser/nokogiri.rb +25 -24
- metadata +124 -52
- data/lib/nokogiri/2.5/nokogiri.so +0 -0
@@ -29,26 +29,26 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
|
|
29
29
|
*
|
30
30
|
* the version string like "1.2.3"
|
31
31
|
*/
|
32
|
-
#define LIBXML_DOTTED_VERSION "2.9.
|
32
|
+
#define LIBXML_DOTTED_VERSION "2.9.13"
|
33
33
|
|
34
34
|
/**
|
35
35
|
* LIBXML_VERSION:
|
36
36
|
*
|
37
37
|
* the version number: 1.2.3 value is 10203
|
38
38
|
*/
|
39
|
-
#define LIBXML_VERSION
|
39
|
+
#define LIBXML_VERSION 20913
|
40
40
|
|
41
41
|
/**
|
42
42
|
* LIBXML_VERSION_STRING:
|
43
43
|
*
|
44
44
|
* the version number string, 1.2.3 value is "10203"
|
45
45
|
*/
|
46
|
-
#define LIBXML_VERSION_STRING "
|
46
|
+
#define LIBXML_VERSION_STRING "20913"
|
47
47
|
|
48
48
|
/**
|
49
49
|
* LIBXML_VERSION_EXTRA:
|
50
50
|
*
|
51
|
-
* extra version information, used to show a
|
51
|
+
* extra version information, used to show a git commit description
|
52
52
|
*/
|
53
53
|
#define LIBXML_VERSION_EXTRA ""
|
54
54
|
|
@@ -58,7 +58,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
|
|
58
58
|
* Macro to check that the libxml version in use is compatible with
|
59
59
|
* the version the software has been compiled against
|
60
60
|
*/
|
61
|
-
#define LIBXML_TEST_VERSION xmlCheckVersion(
|
61
|
+
#define LIBXML_TEST_VERSION xmlCheckVersion(20913);
|
62
62
|
|
63
63
|
#ifndef VMS
|
64
64
|
#if 0
|
@@ -291,6 +291,9 @@ struct _xsltTemplate {
|
|
291
291
|
int templMax; /* Size of the templtes stack */
|
292
292
|
xsltTemplatePtr *templCalledTab; /* templates called */
|
293
293
|
int *templCountTab; /* .. and how often */
|
294
|
+
|
295
|
+
/* Conflict resolution */
|
296
|
+
int position;
|
294
297
|
};
|
295
298
|
|
296
299
|
/**
|
@@ -1500,17 +1503,18 @@ struct _xsltStylesheet {
|
|
1500
1503
|
/*
|
1501
1504
|
* Template descriptions.
|
1502
1505
|
*/
|
1503
|
-
xsltTemplatePtr templates;
|
1504
|
-
|
1505
|
-
|
1506
|
-
|
1507
|
-
|
1508
|
-
|
1509
|
-
|
1510
|
-
|
1511
|
-
|
1512
|
-
|
1513
|
-
|
1506
|
+
xsltTemplatePtr templates; /* the ordered list of templates */
|
1507
|
+
xmlHashTablePtr templatesHash; /* hash table or wherever compiled
|
1508
|
+
templates information is stored */
|
1509
|
+
struct _xsltCompMatch *rootMatch; /* template based on / */
|
1510
|
+
struct _xsltCompMatch *keyMatch; /* template based on key() */
|
1511
|
+
struct _xsltCompMatch *elemMatch; /* template based on * */
|
1512
|
+
struct _xsltCompMatch *attrMatch; /* template based on @* */
|
1513
|
+
struct _xsltCompMatch *parentMatch; /* template based on .. */
|
1514
|
+
struct _xsltCompMatch *textMatch; /* template based on text() */
|
1515
|
+
struct _xsltCompMatch *piMatch; /* template based on
|
1516
|
+
processing-instruction() */
|
1517
|
+
struct _xsltCompMatch *commentMatch; /* template based on comment() */
|
1514
1518
|
|
1515
1519
|
/*
|
1516
1520
|
* Namespace aliases.
|
@@ -20,21 +20,21 @@ extern "C" {
|
|
20
20
|
*
|
21
21
|
* the version string like "1.2.3"
|
22
22
|
*/
|
23
|
-
#define LIBXSLT_DOTTED_VERSION "1.1.
|
23
|
+
#define LIBXSLT_DOTTED_VERSION "1.1.35"
|
24
24
|
|
25
25
|
/**
|
26
26
|
* LIBXSLT_VERSION:
|
27
27
|
*
|
28
28
|
* the version number: 1.2.3 value is 10203
|
29
29
|
*/
|
30
|
-
#define LIBXSLT_VERSION
|
30
|
+
#define LIBXSLT_VERSION 10135
|
31
31
|
|
32
32
|
/**
|
33
33
|
* LIBXSLT_VERSION_STRING:
|
34
34
|
*
|
35
35
|
* the version number string, 1.2.3 value is "10203"
|
36
36
|
*/
|
37
|
-
#define LIBXSLT_VERSION_STRING "
|
37
|
+
#define LIBXSLT_VERSION_STRING "10135"
|
38
38
|
|
39
39
|
/**
|
40
40
|
* LIBXSLT_VERSION_EXTRA:
|
@@ -133,7 +133,7 @@ extern "C" {
|
|
133
133
|
#ifndef WITH_MODULES
|
134
134
|
#define WITH_MODULES
|
135
135
|
#endif
|
136
|
-
#define LIBXSLT_DEFAULT_PLUGINS_PATH() "/home/flavorjones/code/oss/nokogiri/ports/
|
136
|
+
#define LIBXSLT_DEFAULT_PLUGINS_PATH() "/home/flavorjones/code/oss/nokogiri/ports/x86-linux/libxslt/1.1.35/lib/libxslt-plugins"
|
137
137
|
#endif
|
138
138
|
|
139
139
|
/**
|
data/ext/nokogiri/xml_document.c
CHANGED
@@ -533,59 +533,59 @@ block_caller(void *ctx, xmlNodePtr c_node, xmlNodePtr c_parent_node)
|
|
533
533
|
static VALUE
|
534
534
|
rb_xml_document_canonicalize(int argc, VALUE *argv, VALUE self)
|
535
535
|
{
|
536
|
-
VALUE
|
537
|
-
VALUE
|
538
|
-
VALUE
|
539
|
-
xmlChar **
|
540
|
-
long ns_len, i;
|
536
|
+
VALUE rb_mode;
|
537
|
+
VALUE rb_namespaces;
|
538
|
+
VALUE rb_comments_p;
|
539
|
+
xmlChar **c_namespaces;
|
541
540
|
|
542
|
-
xmlDocPtr
|
543
|
-
xmlOutputBufferPtr
|
544
|
-
xmlC14NIsVisibleCallback
|
545
|
-
void *
|
541
|
+
xmlDocPtr c_doc;
|
542
|
+
xmlOutputBufferPtr c_obuf;
|
543
|
+
xmlC14NIsVisibleCallback c_callback_wrapper = NULL;
|
544
|
+
void *rb_callback = NULL;
|
546
545
|
|
547
546
|
VALUE rb_cStringIO;
|
548
|
-
VALUE
|
547
|
+
VALUE rb_io;
|
549
548
|
|
550
|
-
rb_scan_args(argc, argv, "03", &
|
549
|
+
rb_scan_args(argc, argv, "03", &rb_mode, &rb_namespaces, &rb_comments_p);
|
550
|
+
if (!NIL_P(rb_mode)) { Check_Type(rb_mode, T_FIXNUM); }
|
551
|
+
if (!NIL_P(rb_namespaces)) { Check_Type(rb_namespaces, T_ARRAY); }
|
551
552
|
|
552
|
-
Data_Get_Struct(self, xmlDoc,
|
553
|
+
Data_Get_Struct(self, xmlDoc, c_doc);
|
553
554
|
|
554
555
|
rb_cStringIO = rb_const_get_at(rb_cObject, rb_intern("StringIO"));
|
555
|
-
|
556
|
-
|
556
|
+
rb_io = rb_class_new_instance(0, 0, rb_cStringIO);
|
557
|
+
c_obuf = xmlAllocOutputBuffer(NULL);
|
557
558
|
|
558
|
-
|
559
|
-
|
560
|
-
|
559
|
+
c_obuf->writecallback = (xmlOutputWriteCallback)noko_io_write;
|
560
|
+
c_obuf->closecallback = (xmlOutputCloseCallback)noko_io_close;
|
561
|
+
c_obuf->context = (void *)rb_io;
|
561
562
|
|
562
563
|
if (rb_block_given_p()) {
|
563
|
-
|
564
|
-
|
564
|
+
c_callback_wrapper = block_caller;
|
565
|
+
rb_callback = (void *)rb_block_proc();
|
565
566
|
}
|
566
567
|
|
567
|
-
if (NIL_P(
|
568
|
-
|
568
|
+
if (NIL_P(rb_namespaces)) {
|
569
|
+
c_namespaces = NULL;
|
569
570
|
} else {
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
ns[i] = (xmlChar *)StringValueCStr(entry);
|
571
|
+
long ns_len = RARRAY_LEN(rb_namespaces);
|
572
|
+
c_namespaces = calloc((size_t)ns_len + 1, sizeof(xmlChar *));
|
573
|
+
for (int j = 0 ; j < ns_len ; j++) {
|
574
|
+
VALUE entry = rb_ary_entry(rb_namespaces, j);
|
575
|
+
c_namespaces[j] = (xmlChar *)StringValueCStr(entry);
|
576
576
|
}
|
577
577
|
}
|
578
578
|
|
579
|
+
xmlC14NExecute(c_doc, c_callback_wrapper, rb_callback,
|
580
|
+
(int)(NIL_P(rb_mode) ? 0 : NUM2INT(rb_mode)),
|
581
|
+
c_namespaces,
|
582
|
+
(int)RTEST(rb_comments_p),
|
583
|
+
c_obuf);
|
579
584
|
|
580
|
-
|
581
|
-
|
582
|
-
ns,
|
583
|
-
(int) RTEST(with_comments),
|
584
|
-
buf);
|
585
|
-
|
586
|
-
xmlOutputBufferClose(buf);
|
585
|
+
free(c_namespaces);
|
586
|
+
xmlOutputBufferClose(c_obuf);
|
587
587
|
|
588
|
-
return rb_funcall(
|
588
|
+
return rb_funcall(rb_io, rb_intern("string"), 0);
|
589
589
|
}
|
590
590
|
|
591
591
|
VALUE
|
data/ext/nokogiri/xml_dtd.c
CHANGED
@@ -57,9 +57,9 @@ entities(VALUE self)
|
|
57
57
|
|
58
58
|
/*
|
59
59
|
* call-seq:
|
60
|
-
* notations
|
60
|
+
* notations() → Hash<name(String)⇒Notation>
|
61
61
|
*
|
62
|
-
*
|
62
|
+
* [Returns] All the notations for this DTD in a Hash of Notation +name+ to Notation.
|
63
63
|
*/
|
64
64
|
static VALUE
|
65
65
|
notations(VALUE self)
|
@@ -3,70 +3,82 @@
|
|
3
3
|
VALUE cNokogiriEncodingHandler;
|
4
4
|
|
5
5
|
|
6
|
+
static void
|
7
|
+
_xml_encoding_handler_dealloc(xmlCharEncodingHandlerPtr c_handler)
|
8
|
+
{
|
9
|
+
/* make sure iconv handlers are cleaned up and freed */
|
10
|
+
xmlCharEncCloseFunc(c_handler);
|
11
|
+
}
|
12
|
+
|
13
|
+
|
6
14
|
/*
|
7
15
|
* call-seq: Nokogiri::EncodingHandler.[](name)
|
8
16
|
*
|
9
17
|
* Get the encoding handler for +name+
|
10
18
|
*/
|
11
19
|
static VALUE
|
12
|
-
|
20
|
+
rb_xml_encoding_handler_s_get(VALUE klass, VALUE key)
|
13
21
|
{
|
14
22
|
xmlCharEncodingHandlerPtr handler;
|
15
23
|
|
16
24
|
handler = xmlFindCharEncodingHandler(StringValueCStr(key));
|
17
25
|
if (handler) {
|
18
|
-
return Data_Wrap_Struct(klass, NULL,
|
26
|
+
return Data_Wrap_Struct(klass, NULL, _xml_encoding_handler_dealloc, handler);
|
19
27
|
}
|
20
28
|
|
21
29
|
return Qnil;
|
22
30
|
}
|
23
31
|
|
32
|
+
|
24
33
|
/*
|
25
34
|
* call-seq: Nokogiri::EncodingHandler.delete(name)
|
26
35
|
*
|
27
36
|
* Delete the encoding alias named +name+
|
28
37
|
*/
|
29
38
|
static VALUE
|
30
|
-
|
39
|
+
rb_xml_encoding_handler_s_delete(VALUE klass, VALUE name)
|
31
40
|
{
|
32
41
|
if (xmlDelEncodingAlias(StringValueCStr(name))) { return Qnil; }
|
33
42
|
|
34
43
|
return Qtrue;
|
35
44
|
}
|
36
45
|
|
46
|
+
|
37
47
|
/*
|
38
48
|
* call-seq: Nokogiri::EncodingHandler.alias(from, to)
|
39
49
|
*
|
40
50
|
* Alias encoding handler with name +from+ to name +to+
|
41
51
|
*/
|
42
52
|
static VALUE
|
43
|
-
|
53
|
+
rb_xml_encoding_handler_s_alias(VALUE klass, VALUE from, VALUE to)
|
44
54
|
{
|
45
55
|
xmlAddEncodingAlias(StringValueCStr(from), StringValueCStr(to));
|
46
56
|
|
47
57
|
return to;
|
48
58
|
}
|
49
59
|
|
60
|
+
|
50
61
|
/*
|
51
62
|
* call-seq: Nokogiri::EncodingHandler.clear_aliases!
|
52
63
|
*
|
53
64
|
* Remove all encoding aliases.
|
54
65
|
*/
|
55
66
|
static VALUE
|
56
|
-
|
67
|
+
rb_xml_encoding_handler_s_clear_aliases(VALUE klass)
|
57
68
|
{
|
58
69
|
xmlCleanupEncodingAliases();
|
59
70
|
|
60
71
|
return klass;
|
61
72
|
}
|
62
73
|
|
74
|
+
|
63
75
|
/*
|
64
76
|
* call-seq: name
|
65
77
|
*
|
66
78
|
* Get the name of this EncodingHandler
|
67
79
|
*/
|
68
80
|
static VALUE
|
69
|
-
|
81
|
+
rb_xml_encoding_handler_name(VALUE self)
|
70
82
|
{
|
71
83
|
xmlCharEncodingHandlerPtr handler;
|
72
84
|
|
@@ -75,6 +87,7 @@ name(VALUE self)
|
|
75
87
|
return NOKOGIRI_STR_NEW2(handler->name);
|
76
88
|
}
|
77
89
|
|
90
|
+
|
78
91
|
void
|
79
92
|
noko_init_xml_encoding_handler()
|
80
93
|
{
|
@@ -82,9 +95,10 @@ noko_init_xml_encoding_handler()
|
|
82
95
|
|
83
96
|
rb_undef_alloc_func(cNokogiriEncodingHandler);
|
84
97
|
|
85
|
-
rb_define_singleton_method(cNokogiriEncodingHandler, "[]",
|
86
|
-
rb_define_singleton_method(cNokogiriEncodingHandler, "delete",
|
87
|
-
rb_define_singleton_method(cNokogiriEncodingHandler, "alias",
|
88
|
-
rb_define_singleton_method(cNokogiriEncodingHandler, "clear_aliases!",
|
89
|
-
|
98
|
+
rb_define_singleton_method(cNokogiriEncodingHandler, "[]", rb_xml_encoding_handler_s_get, 1);
|
99
|
+
rb_define_singleton_method(cNokogiriEncodingHandler, "delete", rb_xml_encoding_handler_s_delete, 1);
|
100
|
+
rb_define_singleton_method(cNokogiriEncodingHandler, "alias", rb_xml_encoding_handler_s_alias, 2);
|
101
|
+
rb_define_singleton_method(cNokogiriEncodingHandler, "clear_aliases!", rb_xml_encoding_handler_s_clear_aliases, 0);
|
102
|
+
|
103
|
+
rb_define_method(cNokogiriEncodingHandler, "name", rb_xml_encoding_handler_name, 0);
|
90
104
|
}
|