nokogiri 1.10.10 → 1.14.3-aarch64-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 +44 -0
- data/LICENSE-DEPENDENCIES.md +1632 -1022
- data/LICENSE.md +1 -1
- data/README.md +185 -96
- data/bin/nokogiri +63 -50
- data/dependencies.yml +33 -66
- data/ext/nokogiri/depend +38 -358
- data/ext/nokogiri/extconf.rb +819 -421
- data/ext/nokogiri/gumbo.c +594 -0
- data/ext/nokogiri/html4_document.c +166 -0
- data/ext/nokogiri/html4_element_description.c +294 -0
- data/ext/nokogiri/html4_entity_lookup.c +37 -0
- data/ext/nokogiri/html4_sax_parser_context.c +114 -0
- data/ext/nokogiri/html4_sax_push_parser.c +95 -0
- data/ext/nokogiri/include/libexslt/exslt.h +108 -0
- data/ext/nokogiri/include/libexslt/exsltconfig.h +70 -0
- data/ext/nokogiri/include/libexslt/exsltexports.h +63 -0
- data/ext/nokogiri/include/libxml2/libxml/HTMLparser.h +306 -0
- data/ext/nokogiri/include/libxml2/libxml/HTMLtree.h +147 -0
- data/ext/nokogiri/include/libxml2/libxml/SAX.h +204 -0
- data/ext/nokogiri/include/libxml2/libxml/SAX2.h +172 -0
- data/ext/nokogiri/include/libxml2/libxml/c14n.h +128 -0
- data/ext/nokogiri/include/libxml2/libxml/catalog.h +182 -0
- data/ext/nokogiri/include/libxml2/libxml/chvalid.h +230 -0
- data/ext/nokogiri/include/libxml2/libxml/debugXML.h +217 -0
- data/ext/nokogiri/include/libxml2/libxml/dict.h +81 -0
- data/ext/nokogiri/include/libxml2/libxml/encoding.h +232 -0
- data/ext/nokogiri/include/libxml2/libxml/entities.h +153 -0
- data/ext/nokogiri/include/libxml2/libxml/globals.h +499 -0
- data/ext/nokogiri/include/libxml2/libxml/hash.h +236 -0
- data/ext/nokogiri/include/libxml2/libxml/list.h +137 -0
- data/ext/nokogiri/include/libxml2/libxml/nanoftp.h +186 -0
- data/ext/nokogiri/include/libxml2/libxml/nanohttp.h +81 -0
- data/ext/nokogiri/include/libxml2/libxml/parser.h +1244 -0
- data/ext/nokogiri/include/libxml2/libxml/parserInternals.h +656 -0
- data/ext/nokogiri/include/libxml2/libxml/pattern.h +100 -0
- data/ext/nokogiri/include/libxml2/libxml/relaxng.h +218 -0
- data/ext/nokogiri/include/libxml2/libxml/schemasInternals.h +958 -0
- data/ext/nokogiri/include/libxml2/libxml/schematron.h +142 -0
- data/ext/nokogiri/include/libxml2/libxml/threads.h +91 -0
- data/ext/nokogiri/include/libxml2/libxml/tree.h +1312 -0
- data/ext/nokogiri/include/libxml2/libxml/uri.h +94 -0
- data/ext/nokogiri/include/libxml2/libxml/valid.h +463 -0
- data/ext/nokogiri/include/libxml2/libxml/xinclude.h +129 -0
- data/ext/nokogiri/include/libxml2/libxml/xlink.h +189 -0
- data/ext/nokogiri/include/libxml2/libxml/xmlIO.h +368 -0
- data/ext/nokogiri/include/libxml2/libxml/xmlautomata.h +146 -0
- data/ext/nokogiri/include/libxml2/libxml/xmlerror.h +947 -0
- data/ext/nokogiri/include/libxml2/libxml/xmlexports.h +77 -0
- data/ext/nokogiri/include/libxml2/libxml/xmlmemory.h +226 -0
- data/ext/nokogiri/include/libxml2/libxml/xmlmodule.h +57 -0
- data/ext/nokogiri/include/libxml2/libxml/xmlreader.h +428 -0
- data/ext/nokogiri/include/libxml2/libxml/xmlregexp.h +222 -0
- data/ext/nokogiri/include/libxml2/libxml/xmlsave.h +88 -0
- data/ext/nokogiri/include/libxml2/libxml/xmlschemas.h +246 -0
- data/ext/nokogiri/include/libxml2/libxml/xmlschemastypes.h +152 -0
- data/ext/nokogiri/include/libxml2/libxml/xmlstring.h +140 -0
- data/ext/nokogiri/include/libxml2/libxml/xmlunicode.h +202 -0
- data/ext/nokogiri/include/libxml2/libxml/xmlversion.h +503 -0
- data/ext/nokogiri/include/libxml2/libxml/xmlwriter.h +488 -0
- data/ext/nokogiri/include/libxml2/libxml/xpath.h +575 -0
- data/ext/nokogiri/include/libxml2/libxml/xpathInternals.h +632 -0
- data/ext/nokogiri/include/libxml2/libxml/xpointer.h +137 -0
- data/ext/nokogiri/include/libxslt/attributes.h +38 -0
- data/ext/nokogiri/include/libxslt/documents.h +93 -0
- data/ext/nokogiri/include/libxslt/extensions.h +262 -0
- data/ext/nokogiri/include/libxslt/extra.h +72 -0
- data/ext/nokogiri/include/libxslt/functions.h +78 -0
- data/ext/nokogiri/include/libxslt/imports.h +75 -0
- data/ext/nokogiri/include/libxslt/keys.h +53 -0
- data/ext/nokogiri/include/libxslt/namespaces.h +68 -0
- data/ext/nokogiri/include/libxslt/numbersInternals.h +73 -0
- data/ext/nokogiri/include/libxslt/pattern.h +84 -0
- data/ext/nokogiri/include/libxslt/preproc.h +43 -0
- data/ext/nokogiri/include/libxslt/security.h +104 -0
- data/ext/nokogiri/include/libxslt/templates.h +77 -0
- data/ext/nokogiri/include/libxslt/transform.h +207 -0
- data/ext/nokogiri/include/libxslt/variables.h +118 -0
- data/ext/nokogiri/include/libxslt/xslt.h +110 -0
- data/ext/nokogiri/include/libxslt/xsltInternals.h +1982 -0
- data/ext/nokogiri/include/libxslt/xsltconfig.h +179 -0
- data/ext/nokogiri/include/libxslt/xsltexports.h +64 -0
- data/ext/nokogiri/include/libxslt/xsltlocale.h +76 -0
- data/ext/nokogiri/include/libxslt/xsltutils.h +310 -0
- data/ext/nokogiri/libxml2_backwards_compat.c +121 -0
- data/ext/nokogiri/nokogiri.c +228 -104
- data/ext/nokogiri/nokogiri.h +204 -90
- data/ext/nokogiri/test_global_handlers.c +40 -0
- data/ext/nokogiri/xml_attr.c +17 -17
- data/ext/nokogiri/xml_attribute_decl.c +22 -22
- data/ext/nokogiri/xml_cdata.c +15 -20
- data/ext/nokogiri/xml_comment.c +19 -26
- data/ext/nokogiri/xml_document.c +306 -225
- data/ext/nokogiri/xml_document_fragment.c +12 -16
- data/ext/nokogiri/xml_dtd.c +64 -58
- data/ext/nokogiri/xml_element_content.c +33 -28
- data/ext/nokogiri/xml_element_decl.c +26 -26
- data/ext/nokogiri/xml_encoding_handler.c +45 -20
- data/ext/nokogiri/xml_entity_decl.c +37 -35
- data/ext/nokogiri/xml_entity_reference.c +16 -18
- data/ext/nokogiri/xml_namespace.c +136 -61
- data/ext/nokogiri/xml_node.c +1344 -672
- data/ext/nokogiri/xml_node_set.c +178 -168
- data/ext/nokogiri/xml_processing_instruction.c +17 -19
- data/ext/nokogiri/xml_reader.c +316 -190
- data/ext/nokogiri/xml_relax_ng.c +52 -30
- data/ext/nokogiri/xml_sax_parser.c +130 -124
- data/ext/nokogiri/xml_sax_parser_context.c +110 -89
- data/ext/nokogiri/xml_sax_push_parser.c +36 -29
- data/ext/nokogiri/xml_schema.c +98 -50
- data/ext/nokogiri/xml_syntax_error.c +42 -21
- data/ext/nokogiri/xml_text.c +14 -18
- data/ext/nokogiri/xml_xpath_context.c +263 -148
- data/ext/nokogiri/xslt_stylesheet.c +271 -178
- data/gumbo-parser/CHANGES.md +63 -0
- data/gumbo-parser/Makefile +111 -0
- data/gumbo-parser/THANKS +27 -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/3.2/nokogiri.so +0 -0
- data/lib/nokogiri/class_resolver.rb +67 -0
- data/lib/nokogiri/css/node.rb +10 -8
- data/lib/nokogiri/css/parser.rb +397 -377
- data/lib/nokogiri/css/parser.y +250 -245
- data/lib/nokogiri/css/parser_extras.rb +54 -49
- data/lib/nokogiri/css/syntax_error.rb +3 -1
- data/lib/nokogiri/css/tokenizer.rb +5 -3
- data/lib/nokogiri/css/tokenizer.rex +3 -2
- data/lib/nokogiri/css/xpath_visitor.rb +223 -94
- data/lib/nokogiri/css.rb +56 -17
- data/lib/nokogiri/decorators/slop.rb +9 -7
- data/lib/nokogiri/encoding_handler.rb +57 -0
- data/lib/nokogiri/extension.rb +32 -0
- data/lib/nokogiri/gumbo.rb +15 -0
- data/lib/nokogiri/html.rb +38 -27
- data/lib/nokogiri/{html → html4}/builder.rb +4 -2
- data/lib/nokogiri/html4/document.rb +214 -0
- data/lib/nokogiri/html4/document_fragment.rb +54 -0
- data/lib/nokogiri/{html → html4}/element_description.rb +3 -1
- data/lib/nokogiri/html4/element_description_defaults.rb +572 -0
- data/lib/nokogiri/html4/encoding_reader.rb +121 -0
- data/lib/nokogiri/{html → html4}/entity_lookup.rb +4 -2
- data/lib/nokogiri/{html → html4}/sax/parser.rb +17 -16
- data/lib/nokogiri/html4/sax/parser_context.rb +20 -0
- data/lib/nokogiri/{html → html4}/sax/push_parser.rb +12 -11
- data/lib/nokogiri/html4.rb +47 -0
- data/lib/nokogiri/html5/document.rb +168 -0
- data/lib/nokogiri/html5/document_fragment.rb +90 -0
- data/lib/nokogiri/html5/node.rb +98 -0
- data/lib/nokogiri/html5.rb +389 -0
- data/lib/nokogiri/jruby/dependencies.rb +3 -0
- data/lib/nokogiri/jruby/nokogiri_jars.rb +43 -0
- data/lib/nokogiri/syntax_error.rb +2 -0
- data/lib/nokogiri/version/constant.rb +6 -0
- data/lib/nokogiri/version/info.rb +223 -0
- data/lib/nokogiri/version.rb +3 -108
- data/lib/nokogiri/xml/attr.rb +55 -3
- data/lib/nokogiri/xml/attribute_decl.rb +3 -1
- data/lib/nokogiri/xml/builder.rb +75 -34
- data/lib/nokogiri/xml/cdata.rb +3 -1
- data/lib/nokogiri/xml/character_data.rb +2 -0
- data/lib/nokogiri/xml/document.rb +312 -126
- data/lib/nokogiri/xml/document_fragment.rb +93 -48
- data/lib/nokogiri/xml/dtd.rb +4 -2
- data/lib/nokogiri/xml/element_content.rb +2 -0
- data/lib/nokogiri/xml/element_decl.rb +3 -1
- data/lib/nokogiri/xml/entity_decl.rb +4 -2
- data/lib/nokogiri/xml/entity_reference.rb +2 -0
- data/lib/nokogiri/xml/namespace.rb +45 -0
- data/lib/nokogiri/xml/node/save_options.rb +15 -8
- data/lib/nokogiri/xml/node.rb +1067 -406
- data/lib/nokogiri/xml/node_set.rb +135 -59
- data/lib/nokogiri/xml/notation.rb +13 -0
- data/lib/nokogiri/xml/parse_options.rb +145 -52
- data/lib/nokogiri/xml/pp/character_data.rb +9 -6
- data/lib/nokogiri/xml/pp/node.rb +27 -26
- data/lib/nokogiri/xml/pp.rb +4 -2
- data/lib/nokogiri/xml/processing_instruction.rb +4 -1
- data/lib/nokogiri/xml/reader.rb +21 -28
- data/lib/nokogiri/xml/relax_ng.rb +8 -2
- data/lib/nokogiri/xml/sax/document.rb +45 -49
- data/lib/nokogiri/xml/sax/parser.rb +39 -36
- data/lib/nokogiri/xml/sax/parser_context.rb +8 -3
- data/lib/nokogiri/xml/sax/push_parser.rb +6 -5
- data/lib/nokogiri/xml/sax.rb +6 -4
- data/lib/nokogiri/xml/schema.rb +19 -9
- data/lib/nokogiri/xml/searchable.rb +112 -72
- data/lib/nokogiri/xml/syntax_error.rb +6 -4
- data/lib/nokogiri/xml/text.rb +2 -0
- data/lib/nokogiri/xml/xpath/syntax_error.rb +4 -2
- data/lib/nokogiri/xml/xpath.rb +15 -4
- data/lib/nokogiri/xml/xpath_context.rb +3 -3
- data/lib/nokogiri/xml.rb +38 -37
- data/lib/nokogiri/xslt/stylesheet.rb +3 -1
- data/lib/nokogiri/xslt.rb +29 -20
- data/lib/nokogiri.rb +48 -72
- data/lib/xsd/xmlparser/nokogiri.rb +29 -25
- metadata +146 -307
- data/ext/nokogiri/html_document.c +0 -170
- data/ext/nokogiri/html_document.h +0 -10
- data/ext/nokogiri/html_element_description.c +0 -279
- data/ext/nokogiri/html_element_description.h +0 -10
- data/ext/nokogiri/html_entity_lookup.c +0 -32
- data/ext/nokogiri/html_entity_lookup.h +0 -8
- data/ext/nokogiri/html_sax_parser_context.c +0 -116
- data/ext/nokogiri/html_sax_parser_context.h +0 -11
- data/ext/nokogiri/html_sax_push_parser.c +0 -87
- data/ext/nokogiri/html_sax_push_parser.h +0 -9
- data/ext/nokogiri/xml_attr.h +0 -9
- data/ext/nokogiri/xml_attribute_decl.h +0 -9
- data/ext/nokogiri/xml_cdata.h +0 -9
- data/ext/nokogiri/xml_comment.h +0 -9
- data/ext/nokogiri/xml_document.h +0 -23
- data/ext/nokogiri/xml_document_fragment.h +0 -10
- data/ext/nokogiri/xml_dtd.h +0 -10
- data/ext/nokogiri/xml_element_content.h +0 -10
- data/ext/nokogiri/xml_element_decl.h +0 -9
- data/ext/nokogiri/xml_encoding_handler.h +0 -8
- data/ext/nokogiri/xml_entity_decl.h +0 -10
- data/ext/nokogiri/xml_entity_reference.h +0 -9
- data/ext/nokogiri/xml_io.c +0 -61
- data/ext/nokogiri/xml_io.h +0 -11
- data/ext/nokogiri/xml_libxml2_hacks.c +0 -112
- data/ext/nokogiri/xml_libxml2_hacks.h +0 -12
- data/ext/nokogiri/xml_namespace.h +0 -14
- data/ext/nokogiri/xml_node.h +0 -13
- data/ext/nokogiri/xml_node_set.h +0 -12
- data/ext/nokogiri/xml_processing_instruction.h +0 -9
- data/ext/nokogiri/xml_reader.h +0 -10
- data/ext/nokogiri/xml_relax_ng.h +0 -9
- data/ext/nokogiri/xml_sax_parser.h +0 -39
- data/ext/nokogiri/xml_sax_parser_context.h +0 -10
- data/ext/nokogiri/xml_sax_push_parser.h +0 -9
- data/ext/nokogiri/xml_schema.h +0 -9
- data/ext/nokogiri/xml_syntax_error.h +0 -13
- data/ext/nokogiri/xml_text.h +0 -9
- data/ext/nokogiri/xml_xpath_context.h +0 -10
- data/ext/nokogiri/xslt_stylesheet.h +0 -14
- data/lib/nokogiri/html/document.rb +0 -335
- data/lib/nokogiri/html/document_fragment.rb +0 -49
- data/lib/nokogiri/html/element_description_defaults.rb +0 -671
- data/lib/nokogiri/html/sax/parser_context.rb +0 -16
- data/patches/libxml2/0001-Revert-Do-not-URI-escape-in-server-side-includes.patch +0 -78
- data/patches/libxml2/0002-Remove-script-macro-support.patch +0 -40
- data/patches/libxml2/0003-Update-entities-to-remove-handling-of-ssi.patch +0 -44
- data/patches/libxml2/0004-libxml2.la-is-in-top_builddir.patch +0 -25
- data/patches/libxml2/0005-Fix-infinite-loop-in-xmlStringLenDecodeEntities.patch +0 -32
- data/ports/archives/libxml2-2.9.10.tar.gz +0 -0
- data/ports/archives/libxslt-1.1.34.tar.gz +0 -0
data/ext/nokogiri/xml_node_set.c
CHANGED
@@ -1,12 +1,11 @@
|
|
1
|
-
#include <
|
2
|
-
#include <xml_namespace.h>
|
3
|
-
#include <libxml/xpathInternals.h>
|
1
|
+
#include <nokogiri.h>
|
4
2
|
|
5
|
-
|
6
|
-
static void xpath_node_set_del(xmlNodeSetPtr cur, xmlNodePtr val);
|
3
|
+
VALUE cNokogiriXmlNodeSet ;
|
7
4
|
|
5
|
+
static ID decorate ;
|
8
6
|
|
9
|
-
static void
|
7
|
+
static void
|
8
|
+
Check_Node_Set_Node_Type(VALUE node)
|
10
9
|
{
|
11
10
|
if (!(rb_obj_is_kind_of(node, cNokogiriXmlNode) ||
|
12
11
|
rb_obj_is_kind_of(node, cNokogiriXmlNamespace))) {
|
@@ -15,34 +14,92 @@ static void Check_Node_Set_Node_Type(VALUE node)
|
|
15
14
|
}
|
16
15
|
|
17
16
|
|
18
|
-
static
|
17
|
+
static
|
18
|
+
VALUE
|
19
|
+
ruby_object_get(xmlNodePtr c_node)
|
20
|
+
{
|
21
|
+
/* see xmlElementType in libxml2 tree.h */
|
22
|
+
switch (c_node->type) {
|
23
|
+
case XML_NAMESPACE_DECL:
|
24
|
+
/* _private is later in the namespace struct */
|
25
|
+
return (VALUE)(((xmlNsPtr)c_node)->_private);
|
26
|
+
|
27
|
+
case XML_DOCUMENT_NODE:
|
28
|
+
case XML_HTML_DOCUMENT_NODE:
|
29
|
+
/* in documents we use _private to store a tuple */
|
30
|
+
if (DOC_RUBY_OBJECT_TEST(((xmlDocPtr)c_node))) {
|
31
|
+
return DOC_RUBY_OBJECT((xmlDocPtr)c_node);
|
32
|
+
}
|
33
|
+
return (VALUE)NULL;
|
34
|
+
|
35
|
+
default:
|
36
|
+
return (VALUE)(c_node->_private);
|
37
|
+
}
|
38
|
+
}
|
39
|
+
|
40
|
+
|
41
|
+
static void
|
42
|
+
mark(xmlNodeSetPtr node_set)
|
43
|
+
{
|
44
|
+
VALUE rb_node;
|
45
|
+
int jnode;
|
46
|
+
|
47
|
+
for (jnode = 0; jnode < node_set->nodeNr; jnode++) {
|
48
|
+
rb_node = ruby_object_get(node_set->nodeTab[jnode]);
|
49
|
+
if (rb_node) {
|
50
|
+
rb_gc_mark(rb_node);
|
51
|
+
}
|
52
|
+
}
|
53
|
+
}
|
54
|
+
|
55
|
+
static void
|
56
|
+
xpath_node_set_del(xmlNodeSetPtr cur, xmlNodePtr val)
|
57
|
+
{
|
58
|
+
/*
|
59
|
+
* For reasons outlined in xml_namespace.c, here we reproduce xmlXPathNodeSetDel() except for the
|
60
|
+
* offending call to xmlXPathNodeSetFreeNs().
|
61
|
+
*/
|
62
|
+
int i;
|
63
|
+
|
64
|
+
if (cur == NULL) { return; }
|
65
|
+
if (val == NULL) { return; }
|
66
|
+
|
67
|
+
/*
|
68
|
+
* find node in nodeTab
|
69
|
+
*/
|
70
|
+
for (i = 0; i < cur->nodeNr; i++)
|
71
|
+
if (cur->nodeTab[i] == val) { break; }
|
72
|
+
|
73
|
+
if (i >= cur->nodeNr) { /* not found */
|
74
|
+
return;
|
75
|
+
}
|
76
|
+
cur->nodeNr--;
|
77
|
+
for (; i < cur->nodeNr; i++) {
|
78
|
+
cur->nodeTab[i] = cur->nodeTab[i + 1];
|
79
|
+
}
|
80
|
+
cur->nodeTab[cur->nodeNr] = NULL;
|
81
|
+
}
|
82
|
+
|
83
|
+
|
84
|
+
static void
|
85
|
+
deallocate(xmlNodeSetPtr node_set)
|
19
86
|
{
|
20
87
|
/*
|
21
|
-
*
|
22
|
-
*
|
23
|
-
* xmlXPathFreeNodeSet() frees those xmlNs structs that are in the
|
24
|
-
* NodeSet.
|
25
|
-
*
|
26
|
-
* this is bad if someone is still trying to use the Namespace object wrapped
|
27
|
-
* around the xmlNs, so we need to avoid that.
|
28
|
-
*
|
29
|
-
* here we reproduce xmlXPathFreeNodeSet() without the xmlNs logic.
|
30
|
-
*
|
31
|
-
* this doesn't cause a leak because Namespace objects that are in an XPath
|
32
|
-
* query NodeSet are given their own lifecycle in
|
33
|
-
* Nokogiri_wrap_xml_namespace().
|
88
|
+
* For reasons outlined in xml_namespace.c, here we reproduce xmlXPathFreeNodeSet() except for the
|
89
|
+
* offending call to xmlXPathNodeSetFreeNs().
|
34
90
|
*/
|
35
|
-
|
36
|
-
if (node_set->nodeTab != NULL)
|
91
|
+
if (node_set->nodeTab != NULL) {
|
37
92
|
xmlFree(node_set->nodeTab);
|
93
|
+
}
|
38
94
|
|
39
95
|
xmlFree(node_set);
|
40
|
-
NOKOGIRI_DEBUG_END(node_set) ;
|
41
96
|
}
|
42
97
|
|
43
|
-
|
98
|
+
|
99
|
+
static VALUE
|
100
|
+
allocate(VALUE klass)
|
44
101
|
{
|
45
|
-
return
|
102
|
+
return noko_xml_node_set_wrap(xmlXPathNodeSetCreate(NULL), Qnil);
|
46
103
|
}
|
47
104
|
|
48
105
|
|
@@ -53,7 +110,8 @@ static VALUE allocate(VALUE klass)
|
|
53
110
|
* Duplicate this NodeSet. Note that the Nodes contained in the NodeSet are not
|
54
111
|
* duplicated (similar to how Array and other Enumerable classes work).
|
55
112
|
*/
|
56
|
-
static VALUE
|
113
|
+
static VALUE
|
114
|
+
duplicate(VALUE self)
|
57
115
|
{
|
58
116
|
xmlNodeSetPtr node_set;
|
59
117
|
xmlNodeSetPtr dupl;
|
@@ -62,7 +120,7 @@ static VALUE duplicate(VALUE self)
|
|
62
120
|
|
63
121
|
dupl = xmlXPathNodeSetMerge(NULL, node_set);
|
64
122
|
|
65
|
-
return
|
123
|
+
return noko_xml_node_set_wrap(dupl, rb_iv_get(self, "@document"));
|
66
124
|
}
|
67
125
|
|
68
126
|
/*
|
@@ -71,7 +129,8 @@ static VALUE duplicate(VALUE self)
|
|
71
129
|
*
|
72
130
|
* Get the length of the node set
|
73
131
|
*/
|
74
|
-
static VALUE
|
132
|
+
static VALUE
|
133
|
+
length(VALUE self)
|
75
134
|
{
|
76
135
|
xmlNodeSetPtr node_set;
|
77
136
|
|
@@ -86,7 +145,8 @@ static VALUE length(VALUE self)
|
|
86
145
|
*
|
87
146
|
* Append +node+ to the NodeSet.
|
88
147
|
*/
|
89
|
-
static VALUE
|
148
|
+
static VALUE
|
149
|
+
push(VALUE self, VALUE rb_node)
|
90
150
|
{
|
91
151
|
xmlNodeSetPtr node_set;
|
92
152
|
xmlNodePtr node;
|
@@ -94,7 +154,7 @@ static VALUE push(VALUE self, VALUE rb_node)
|
|
94
154
|
Check_Node_Set_Node_Type(rb_node);
|
95
155
|
|
96
156
|
Data_Get_Struct(self, xmlNodeSet, node_set);
|
97
|
-
|
157
|
+
Noko_Node_Get_Struct(rb_node, xmlNode, node);
|
98
158
|
|
99
159
|
xmlXPathNodeSetAdd(node_set, node);
|
100
160
|
|
@@ -109,7 +169,7 @@ static VALUE push(VALUE self, VALUE rb_node)
|
|
109
169
|
* if found, otherwise returns nil.
|
110
170
|
*/
|
111
171
|
static VALUE
|
112
|
-
delete(VALUE self, VALUE rb_node)
|
172
|
+
delete (VALUE self, VALUE rb_node)
|
113
173
|
{
|
114
174
|
xmlNodeSetPtr node_set;
|
115
175
|
xmlNodePtr node;
|
@@ -117,7 +177,7 @@ delete(VALUE self, VALUE rb_node)
|
|
117
177
|
Check_Node_Set_Node_Type(rb_node);
|
118
178
|
|
119
179
|
Data_Get_Struct(self, xmlNodeSet, node_set);
|
120
|
-
|
180
|
+
Noko_Node_Get_Struct(rb_node, xmlNode, node);
|
121
181
|
|
122
182
|
if (xmlXPathNodeSetContains(node_set, node)) {
|
123
183
|
xpath_node_set_del(node_set, node);
|
@@ -133,19 +193,21 @@ delete(VALUE self, VALUE rb_node)
|
|
133
193
|
*
|
134
194
|
* Set Intersection — Returns a new NodeSet containing nodes common to the two NodeSets.
|
135
195
|
*/
|
136
|
-
static VALUE
|
196
|
+
static VALUE
|
197
|
+
intersection(VALUE self, VALUE rb_other)
|
137
198
|
{
|
138
199
|
xmlNodeSetPtr node_set, other ;
|
139
200
|
xmlNodeSetPtr intersection;
|
140
201
|
|
141
|
-
if(!rb_obj_is_kind_of(rb_other, cNokogiriXmlNodeSet))
|
202
|
+
if (!rb_obj_is_kind_of(rb_other, cNokogiriXmlNodeSet)) {
|
142
203
|
rb_raise(rb_eArgError, "node_set must be a Nokogiri::XML::NodeSet");
|
204
|
+
}
|
143
205
|
|
144
206
|
Data_Get_Struct(self, xmlNodeSet, node_set);
|
145
207
|
Data_Get_Struct(rb_other, xmlNodeSet, other);
|
146
208
|
|
147
209
|
intersection = xmlXPathIntersection(node_set, other);
|
148
|
-
return
|
210
|
+
return noko_xml_node_set_wrap(intersection, rb_iv_get(self, "@document"));
|
149
211
|
}
|
150
212
|
|
151
213
|
|
@@ -155,7 +217,8 @@ static VALUE intersection(VALUE self, VALUE rb_other)
|
|
155
217
|
*
|
156
218
|
* Returns true if any member of node set equals +node+.
|
157
219
|
*/
|
158
|
-
static VALUE
|
220
|
+
static VALUE
|
221
|
+
include_eh(VALUE self, VALUE rb_node)
|
159
222
|
{
|
160
223
|
xmlNodeSetPtr node_set;
|
161
224
|
xmlNodePtr node;
|
@@ -163,7 +226,7 @@ static VALUE include_eh(VALUE self, VALUE rb_node)
|
|
163
226
|
Check_Node_Set_Node_Type(rb_node);
|
164
227
|
|
165
228
|
Data_Get_Struct(self, xmlNodeSet, node_set);
|
166
|
-
|
229
|
+
Noko_Node_Get_Struct(rb_node, xmlNode, node);
|
167
230
|
|
168
231
|
return (xmlXPathNodeSetContains(node_set, node) ? Qtrue : Qfalse);
|
169
232
|
}
|
@@ -176,21 +239,23 @@ static VALUE include_eh(VALUE self, VALUE rb_node)
|
|
176
239
|
* Returns a new set built by merging the set and the elements of the given
|
177
240
|
* set.
|
178
241
|
*/
|
179
|
-
static VALUE
|
242
|
+
static VALUE
|
243
|
+
rb_xml_node_set_union(VALUE rb_node_set, VALUE rb_other)
|
180
244
|
{
|
181
|
-
xmlNodeSetPtr
|
182
|
-
xmlNodeSetPtr
|
245
|
+
xmlNodeSetPtr c_node_set, c_other;
|
246
|
+
xmlNodeSetPtr c_new_node_set;
|
183
247
|
|
184
|
-
if(!rb_obj_is_kind_of(rb_other, cNokogiriXmlNodeSet))
|
248
|
+
if (!rb_obj_is_kind_of(rb_other, cNokogiriXmlNodeSet)) {
|
185
249
|
rb_raise(rb_eArgError, "node_set must be a Nokogiri::XML::NodeSet");
|
250
|
+
}
|
186
251
|
|
187
|
-
Data_Get_Struct(
|
188
|
-
Data_Get_Struct(rb_other, xmlNodeSet,
|
252
|
+
Data_Get_Struct(rb_node_set, xmlNodeSet, c_node_set);
|
253
|
+
Data_Get_Struct(rb_other, xmlNodeSet, c_other);
|
189
254
|
|
190
|
-
|
191
|
-
|
255
|
+
c_new_node_set = xmlXPathNodeSetMerge(NULL, c_node_set);
|
256
|
+
c_new_node_set = xmlXPathNodeSetMerge(c_new_node_set, c_other);
|
192
257
|
|
193
|
-
return
|
258
|
+
return noko_xml_node_set_wrap(c_new_node_set, rb_iv_get(rb_node_set, "@document"));
|
194
259
|
}
|
195
260
|
|
196
261
|
/*
|
@@ -200,14 +265,16 @@ static VALUE set_union(VALUE self, VALUE rb_other)
|
|
200
265
|
* Difference - returns a new NodeSet that is a copy of this NodeSet, removing
|
201
266
|
* each item that also appears in +node_set+
|
202
267
|
*/
|
203
|
-
static VALUE
|
268
|
+
static VALUE
|
269
|
+
minus(VALUE self, VALUE rb_other)
|
204
270
|
{
|
205
271
|
xmlNodeSetPtr node_set, other;
|
206
272
|
xmlNodeSetPtr new;
|
207
273
|
int j ;
|
208
274
|
|
209
|
-
if(!rb_obj_is_kind_of(rb_other, cNokogiriXmlNodeSet))
|
275
|
+
if (!rb_obj_is_kind_of(rb_other, cNokogiriXmlNodeSet)) {
|
210
276
|
rb_raise(rb_eArgError, "node_set must be a Nokogiri::XML::NodeSet");
|
277
|
+
}
|
211
278
|
|
212
279
|
Data_Get_Struct(self, xmlNodeSet, node_set);
|
213
280
|
Data_Get_Struct(rb_other, xmlNodeSet, other);
|
@@ -217,11 +284,12 @@ static VALUE minus(VALUE self, VALUE rb_other)
|
|
217
284
|
xpath_node_set_del(new, other->nodeTab[j]);
|
218
285
|
}
|
219
286
|
|
220
|
-
return
|
287
|
+
return noko_xml_node_set_wrap(new, rb_iv_get(self, "@document"));
|
221
288
|
}
|
222
289
|
|
223
290
|
|
224
|
-
static VALUE
|
291
|
+
static VALUE
|
292
|
+
index_at(VALUE self, long offset)
|
225
293
|
{
|
226
294
|
xmlNodeSetPtr node_set;
|
227
295
|
|
@@ -233,10 +301,11 @@ static VALUE index_at(VALUE self, long offset)
|
|
233
301
|
|
234
302
|
if (offset < 0) { offset += node_set->nodeNr ; }
|
235
303
|
|
236
|
-
return
|
304
|
+
return noko_xml_node_wrap_node_set_result(node_set->nodeTab[offset], self);
|
237
305
|
}
|
238
306
|
|
239
|
-
static VALUE
|
307
|
+
static VALUE
|
308
|
+
subseq(VALUE self, long beg, long len)
|
240
309
|
{
|
241
310
|
long j;
|
242
311
|
xmlNodeSetPtr node_set;
|
@@ -244,18 +313,18 @@ static VALUE subseq(VALUE self, long beg, long len)
|
|
244
313
|
|
245
314
|
Data_Get_Struct(self, xmlNodeSet, node_set);
|
246
315
|
|
247
|
-
if (beg > node_set->nodeNr) return Qnil ;
|
248
|
-
if (beg < 0 || len < 0) return Qnil ;
|
316
|
+
if (beg > node_set->nodeNr) { return Qnil ; }
|
317
|
+
if (beg < 0 || len < 0) { return Qnil ; }
|
249
318
|
|
250
319
|
if ((beg + len) > node_set->nodeNr) {
|
251
320
|
len = node_set->nodeNr - beg ;
|
252
321
|
}
|
253
322
|
|
254
323
|
new_set = xmlXPathNodeSetCreate(NULL);
|
255
|
-
for (j = beg ; j < beg+len ; ++j) {
|
324
|
+
for (j = beg ; j < beg + len ; ++j) {
|
256
325
|
xmlXPathNodeSetAddUnique(new_set, node_set->nodeTab[j]);
|
257
326
|
}
|
258
|
-
return
|
327
|
+
return noko_xml_node_set_wrap(new_set, rb_iv_get(self, "@document"));
|
259
328
|
}
|
260
329
|
|
261
330
|
/*
|
@@ -273,7 +342,8 @@ static VALUE subseq(VALUE self, long beg, long len)
|
|
273
342
|
* count backward from the end of the +node_set+ (-1 is the last node). Returns
|
274
343
|
* nil if the +index+ (or +start+) are out of range.
|
275
344
|
*/
|
276
|
-
static VALUE
|
345
|
+
static VALUE
|
346
|
+
slice(int argc, VALUE *argv, VALUE self)
|
277
347
|
{
|
278
348
|
VALUE arg ;
|
279
349
|
long beg, len ;
|
@@ -301,12 +371,12 @@ static VALUE slice(int argc, VALUE *argv, VALUE self)
|
|
301
371
|
|
302
372
|
/* if arg is Range */
|
303
373
|
switch (rb_range_beg_len(arg, &beg, &len, (long)node_set->nodeNr, 0)) {
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
374
|
+
case Qfalse:
|
375
|
+
break;
|
376
|
+
case Qnil:
|
377
|
+
return Qnil;
|
378
|
+
default:
|
379
|
+
return subseq(self, beg, len);
|
310
380
|
}
|
311
381
|
|
312
382
|
return index_at(self, NUM2LONG(arg));
|
@@ -319,7 +389,8 @@ static VALUE slice(int argc, VALUE *argv, VALUE self)
|
|
319
389
|
*
|
320
390
|
* Return this list as an Array
|
321
391
|
*/
|
322
|
-
static VALUE
|
392
|
+
static VALUE
|
393
|
+
to_array(VALUE self)
|
323
394
|
{
|
324
395
|
xmlNodeSetPtr node_set ;
|
325
396
|
VALUE list;
|
@@ -328,9 +399,9 @@ static VALUE to_array(VALUE self, VALUE rb_node)
|
|
328
399
|
Data_Get_Struct(self, xmlNodeSet, node_set);
|
329
400
|
|
330
401
|
list = rb_ary_new2(node_set->nodeNr);
|
331
|
-
for(i = 0; i < node_set->nodeNr; i++) {
|
332
|
-
VALUE elt =
|
333
|
-
rb_ary_push(
|
402
|
+
for (i = 0; i < node_set->nodeNr; i++) {
|
403
|
+
VALUE elt = noko_xml_node_wrap_node_set_result(node_set->nodeTab[i], self);
|
404
|
+
rb_ary_push(list, elt);
|
334
405
|
}
|
335
406
|
|
336
407
|
return list;
|
@@ -342,7 +413,8 @@ static VALUE to_array(VALUE self, VALUE rb_node)
|
|
342
413
|
*
|
343
414
|
* Unlink this NodeSet and all Node objects it contains from their current context.
|
344
415
|
*/
|
345
|
-
static VALUE
|
416
|
+
static VALUE
|
417
|
+
unlink_nodeset(VALUE self)
|
346
418
|
{
|
347
419
|
xmlNodeSetPtr node_set;
|
348
420
|
int j, nodeNr ;
|
@@ -354,9 +426,9 @@ static VALUE unlink_nodeset(VALUE self)
|
|
354
426
|
if (! NOKOGIRI_NAMESPACE_EH(node_set->nodeTab[j])) {
|
355
427
|
VALUE node ;
|
356
428
|
xmlNodePtr node_ptr;
|
357
|
-
node =
|
429
|
+
node = noko_xml_node_wrap(Qnil, node_set->nodeTab[j]);
|
358
430
|
rb_funcall(node, rb_intern("unlink"), 0); /* modifies the C struct out from under the object */
|
359
|
-
|
431
|
+
Noko_Node_Get_Struct(node, xmlNode, node_ptr);
|
360
432
|
node_set->nodeTab[j] = node_ptr ;
|
361
433
|
}
|
362
434
|
}
|
@@ -364,123 +436,61 @@ static VALUE unlink_nodeset(VALUE self)
|
|
364
436
|
}
|
365
437
|
|
366
438
|
|
367
|
-
|
439
|
+
VALUE
|
440
|
+
noko_xml_node_set_wrap(xmlNodeSetPtr c_node_set, VALUE document)
|
368
441
|
{
|
369
|
-
|
370
|
-
|
371
|
-
* NodeSet are duplicates, and we don't clean them up at deallocate() time.
|
372
|
-
*
|
373
|
-
* as a result, we need to make sure the Ruby manages this memory. we do this
|
374
|
-
* by forcing the creation of a Ruby object wrapped around the xmlNs.
|
375
|
-
*
|
376
|
-
* we also have to make sure that the NodeSet has a reference to the
|
377
|
-
* Namespace object, otherwise GC will kick in and the Namespace won't be
|
378
|
-
* marked.
|
379
|
-
*
|
380
|
-
* we *could* do this safely with *all* the nodes in the NodeSet, but we only
|
381
|
-
* *need* to do it for xmlNs structs, and so you get the code we have here.
|
382
|
-
*/
|
383
|
-
int j ;
|
384
|
-
xmlNodeSetPtr node_set ;
|
385
|
-
VALUE namespace_cache ;
|
386
|
-
|
387
|
-
Data_Get_Struct(self, xmlNodeSet, node_set);
|
388
|
-
|
389
|
-
namespace_cache = rb_iv_get(self, "@namespace_cache");
|
442
|
+
int j;
|
443
|
+
VALUE rb_node_set ;
|
390
444
|
|
391
|
-
|
392
|
-
|
393
|
-
rb_ary_push(namespace_cache, Nokogiri_wrap_xml_node_set_node(node_set->nodeTab[j], self));
|
394
|
-
}
|
445
|
+
if (c_node_set == NULL) {
|
446
|
+
c_node_set = xmlXPathNodeSetCreate(NULL);
|
395
447
|
}
|
396
|
-
}
|
397
|
-
|
398
448
|
|
399
|
-
|
400
|
-
{
|
401
|
-
VALUE new_set ;
|
402
|
-
|
403
|
-
if (node_set == NULL) {
|
404
|
-
node_set = xmlXPathNodeSetCreate(NULL);
|
405
|
-
}
|
406
|
-
|
407
|
-
new_set = Data_Wrap_Struct(cNokogiriXmlNodeSet, 0, deallocate, node_set);
|
449
|
+
rb_node_set = Data_Wrap_Struct(cNokogiriXmlNodeSet, mark, deallocate, c_node_set);
|
408
450
|
|
409
451
|
if (!NIL_P(document)) {
|
410
|
-
rb_iv_set(
|
411
|
-
rb_funcall(document, decorate, 1,
|
452
|
+
rb_iv_set(rb_node_set, "@document", document);
|
453
|
+
rb_funcall(document, decorate, 1, rb_node_set);
|
412
454
|
}
|
413
455
|
|
414
|
-
|
415
|
-
|
456
|
+
/* make sure we create ruby objects for all the results, so they'll be marked during the GC mark phase */
|
457
|
+
for (j = 0 ; j < c_node_set->nodeNr ; j++) {
|
458
|
+
noko_xml_node_wrap_node_set_result(c_node_set->nodeTab[j], rb_node_set);
|
459
|
+
}
|
416
460
|
|
417
|
-
return
|
461
|
+
return rb_node_set ;
|
418
462
|
}
|
419
463
|
|
420
|
-
VALUE
|
464
|
+
VALUE
|
465
|
+
noko_xml_node_wrap_node_set_result(xmlNodePtr node, VALUE node_set)
|
421
466
|
{
|
422
|
-
xmlDocPtr document ;
|
423
|
-
|
424
467
|
if (NOKOGIRI_NAMESPACE_EH(node)) {
|
425
|
-
|
426
|
-
return Nokogiri_wrap_xml_namespace(document, (xmlNsPtr)node);
|
468
|
+
return noko_xml_namespace_wrap_xpath_copy((xmlNsPtr)node);
|
427
469
|
} else {
|
428
|
-
return
|
470
|
+
return noko_xml_node_wrap(Qnil, node);
|
429
471
|
}
|
430
472
|
}
|
431
473
|
|
432
474
|
|
433
|
-
|
434
|
-
|
435
|
-
/*
|
436
|
-
* as mentioned a few times above, we do not want to free xmlNs structs
|
437
|
-
* outside of the Namespace lifecycle.
|
438
|
-
*
|
439
|
-
* xmlXPathNodeSetDel() frees xmlNs structs, and so here we reproduce that
|
440
|
-
* function with the xmlNs logic.
|
441
|
-
*/
|
442
|
-
int i;
|
443
|
-
|
444
|
-
if (cur == NULL) return;
|
445
|
-
if (val == NULL) return;
|
446
|
-
|
447
|
-
/*
|
448
|
-
* find node in nodeTab
|
449
|
-
*/
|
450
|
-
for (i = 0;i < cur->nodeNr;i++)
|
451
|
-
if (cur->nodeTab[i] == val) break;
|
452
|
-
|
453
|
-
if (i >= cur->nodeNr) { /* not found */
|
454
|
-
return;
|
455
|
-
}
|
456
|
-
cur->nodeNr--;
|
457
|
-
for (;i < cur->nodeNr;i++)
|
458
|
-
cur->nodeTab[i] = cur->nodeTab[i + 1];
|
459
|
-
cur->nodeTab[cur->nodeNr] = NULL;
|
460
|
-
}
|
461
|
-
|
462
|
-
|
463
|
-
VALUE cNokogiriXmlNodeSet ;
|
464
|
-
void init_xml_node_set(void)
|
475
|
+
void
|
476
|
+
noko_init_xml_node_set(void)
|
465
477
|
{
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
rb_define_method(
|
473
|
-
rb_define_method(
|
474
|
-
rb_define_method(
|
475
|
-
rb_define_method(
|
476
|
-
rb_define_method(
|
477
|
-
rb_define_method(
|
478
|
-
rb_define_method(
|
479
|
-
rb_define_method(
|
480
|
-
rb_define_method(
|
481
|
-
rb_define_method(
|
482
|
-
rb_define_method(klass, "&", intersection, 1);
|
483
|
-
rb_define_method(klass, "include?", include_eh, 1);
|
478
|
+
cNokogiriXmlNodeSet = rb_define_class_under(mNokogiriXml, "NodeSet", rb_cObject);
|
479
|
+
|
480
|
+
rb_define_alloc_func(cNokogiriXmlNodeSet, allocate);
|
481
|
+
|
482
|
+
rb_define_method(cNokogiriXmlNodeSet, "length", length, 0);
|
483
|
+
rb_define_method(cNokogiriXmlNodeSet, "[]", slice, -1);
|
484
|
+
rb_define_method(cNokogiriXmlNodeSet, "slice", slice, -1);
|
485
|
+
rb_define_method(cNokogiriXmlNodeSet, "push", push, 1);
|
486
|
+
rb_define_method(cNokogiriXmlNodeSet, "|", rb_xml_node_set_union, 1);
|
487
|
+
rb_define_method(cNokogiriXmlNodeSet, "-", minus, 1);
|
488
|
+
rb_define_method(cNokogiriXmlNodeSet, "unlink", unlink_nodeset, 0);
|
489
|
+
rb_define_method(cNokogiriXmlNodeSet, "to_a", to_array, 0);
|
490
|
+
rb_define_method(cNokogiriXmlNodeSet, "dup", duplicate, 0);
|
491
|
+
rb_define_method(cNokogiriXmlNodeSet, "delete", delete, 1);
|
492
|
+
rb_define_method(cNokogiriXmlNodeSet, "&", intersection, 1);
|
493
|
+
rb_define_method(cNokogiriXmlNodeSet, "include?", include_eh, 1);
|
484
494
|
|
485
495
|
decorate = rb_intern("decorate");
|
486
496
|
}
|
@@ -1,4 +1,6 @@
|
|
1
|
-
#include <
|
1
|
+
#include <nokogiri.h>
|
2
|
+
|
3
|
+
VALUE cNokogiriXmlProcessingInstruction;
|
2
4
|
|
3
5
|
/*
|
4
6
|
* call-seq:
|
@@ -7,7 +9,8 @@
|
|
7
9
|
* Create a new ProcessingInstruction element on the +document+ with +name+
|
8
10
|
* and +content+
|
9
11
|
*/
|
10
|
-
static VALUE
|
12
|
+
static VALUE
|
13
|
+
new (int argc, VALUE *argv, VALUE klass)
|
11
14
|
{
|
12
15
|
xmlDocPtr xml_doc;
|
13
16
|
xmlNodePtr node;
|
@@ -22,35 +25,30 @@ static VALUE new(int argc, VALUE *argv, VALUE klass)
|
|
22
25
|
Data_Get_Struct(document, xmlDoc, xml_doc);
|
23
26
|
|
24
27
|
node = xmlNewDocPI(
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
28
|
+
xml_doc,
|
29
|
+
(const xmlChar *)StringValueCStr(name),
|
30
|
+
(const xmlChar *)StringValueCStr(content)
|
31
|
+
);
|
29
32
|
|
30
|
-
|
33
|
+
noko_xml_document_pin_node(node);
|
31
34
|
|
32
|
-
rb_node =
|
35
|
+
rb_node = noko_xml_node_wrap(klass, node);
|
33
36
|
rb_obj_call_init(rb_node, argc, argv);
|
34
37
|
|
35
|
-
if(rb_block_given_p()) rb_yield(rb_node);
|
38
|
+
if (rb_block_given_p()) { rb_yield(rb_node); }
|
36
39
|
|
37
40
|
return rb_node;
|
38
41
|
}
|
39
42
|
|
40
|
-
|
41
|
-
void
|
43
|
+
void
|
44
|
+
noko_init_xml_processing_instruction(void)
|
42
45
|
{
|
43
|
-
|
44
|
-
VALUE xml = rb_define_module_under(nokogiri, "XML");
|
45
|
-
VALUE node = rb_define_class_under(xml, "Node", rb_cObject);
|
46
|
-
|
46
|
+
assert(cNokogiriXmlNode);
|
47
47
|
/*
|
48
48
|
* ProcessingInstruction represents a ProcessingInstruction node in an xml
|
49
49
|
* document.
|
50
50
|
*/
|
51
|
-
|
52
|
-
|
53
|
-
cNokogiriXmlProcessingInstruction = klass;
|
51
|
+
cNokogiriXmlProcessingInstruction = rb_define_class_under(mNokogiriXml, "ProcessingInstruction", cNokogiriXmlNode);
|
54
52
|
|
55
|
-
rb_define_singleton_method(
|
53
|
+
rb_define_singleton_method(cNokogiriXmlProcessingInstruction, "new", new, -1);
|
56
54
|
}
|