nokogiri 1.4.1-x86-mswin32 → 1.4.2.1-x86-mswin32
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.
- data/CHANGELOG.ja.rdoc +45 -0
- data/CHANGELOG.rdoc +53 -1
- data/Manifest.txt +3 -3
- data/README.ja.rdoc +1 -1
- data/README.rdoc +11 -5
- data/Rakefile +13 -79
- data/ext/nokogiri/extconf.rb +25 -74
- data/ext/nokogiri/html_document.c +17 -8
- data/ext/nokogiri/html_element_description.c +20 -16
- data/ext/nokogiri/html_entity_lookup.c +2 -2
- data/ext/nokogiri/html_sax_parser_context.c +10 -8
- data/ext/nokogiri/nokogiri.c +0 -1
- data/ext/nokogiri/nokogiri.h +33 -28
- data/ext/nokogiri/xml_attr.c +7 -5
- data/ext/nokogiri/xml_attribute_decl.c +5 -2
- data/ext/nokogiri/xml_cdata.c +4 -2
- data/ext/nokogiri/xml_comment.c +4 -2
- data/ext/nokogiri/xml_document.c +93 -15
- data/ext/nokogiri/xml_document.h +0 -1
- data/ext/nokogiri/xml_document_fragment.c +4 -2
- data/ext/nokogiri/xml_dtd.c +18 -8
- data/ext/nokogiri/xml_element_content.c +2 -2
- data/ext/nokogiri/xml_entity_decl.c +15 -2
- data/ext/nokogiri/xml_entity_reference.c +4 -2
- data/ext/nokogiri/xml_io.c +1 -1
- data/ext/nokogiri/xml_namespace.c +5 -3
- data/ext/nokogiri/xml_node.c +353 -114
- data/ext/nokogiri/xml_node_set.c +35 -22
- data/ext/nokogiri/xml_node_set.h +1 -1
- data/ext/nokogiri/xml_processing_instruction.c +4 -2
- data/ext/nokogiri/xml_reader.c +119 -47
- data/ext/nokogiri/xml_relax_ng.c +21 -12
- data/ext/nokogiri/xml_sax_parser.c +6 -3
- data/ext/nokogiri/xml_sax_parser.h +13 -17
- data/ext/nokogiri/xml_sax_parser_context.c +8 -6
- data/ext/nokogiri/xml_sax_push_parser.c +7 -6
- data/ext/nokogiri/xml_schema.c +62 -13
- data/ext/nokogiri/xml_syntax_error.c +18 -12
- data/ext/nokogiri/xml_syntax_error.h +1 -1
- data/ext/nokogiri/xml_text.c +4 -2
- data/ext/nokogiri/xml_xpath_context.c +60 -23
- data/ext/nokogiri/xslt_stylesheet.c +14 -3
- data/lib/nokogiri.rb +17 -0
- data/lib/nokogiri/1.8/nokogiri.so +0 -0
- data/lib/nokogiri/1.9/nokogiri.so +0 -0
- data/lib/nokogiri/css/generated_parser.rb +72 -62
- data/lib/nokogiri/css/generated_tokenizer.rb +23 -23
- data/lib/nokogiri/css/parser.y +3 -1
- data/lib/nokogiri/css/tokenizer.rex +3 -3
- data/lib/nokogiri/css/xpath_visitor.rb +8 -3
- data/lib/nokogiri/ffi/html/sax/parser_context.rb +3 -3
- data/lib/nokogiri/ffi/libxml.rb +16 -2
- data/lib/nokogiri/ffi/structs/common_node.rb +15 -3
- data/lib/nokogiri/ffi/structs/xml_document.rb +13 -4
- data/lib/nokogiri/ffi/structs/xml_xpath_context.rb +3 -2
- data/lib/nokogiri/ffi/weak_bucket.rb +40 -0
- data/lib/nokogiri/ffi/xml/document.rb +27 -0
- data/lib/nokogiri/ffi/xml/entity_decl.rb +9 -0
- data/lib/nokogiri/ffi/xml/node.rb +142 -61
- data/lib/nokogiri/ffi/xml/node_set.rb +15 -12
- data/lib/nokogiri/ffi/xml/reader.rb +5 -0
- data/lib/nokogiri/ffi/xml/schema.rb +17 -0
- data/lib/nokogiri/ffi/xml/syntax_error.rb +4 -4
- data/lib/nokogiri/ffi/xml/xpath.rb +0 -10
- data/lib/nokogiri/ffi/xml/xpath_context.rb +22 -9
- data/lib/nokogiri/ffi/xslt/stylesheet.rb +3 -0
- data/lib/nokogiri/html/document.rb +5 -3
- data/lib/nokogiri/html/document_fragment.rb +28 -7
- data/lib/nokogiri/version.rb +6 -2
- data/lib/nokogiri/version_warning.rb +6 -3
- data/lib/nokogiri/xml.rb +1 -1
- data/lib/nokogiri/xml/builder.rb +35 -22
- data/lib/nokogiri/xml/document.rb +44 -12
- data/lib/nokogiri/xml/document_fragment.rb +16 -12
- data/lib/nokogiri/xml/entity_decl.rb +4 -0
- data/lib/nokogiri/xml/node.rb +152 -95
- data/lib/nokogiri/xml/node_set.rb +2 -1
- data/lib/nokogiri/xml/sax/push_parser.rb +1 -1
- data/lib/nokogiri/xml/schema.rb +1 -5
- data/lib/nokogiri/xml/syntax_error.rb +4 -0
- data/lib/nokogiri/xml/text.rb +9 -0
- data/lib/nokogiri/xml/xpath/syntax_error.rb +3 -0
- data/tasks/cross_compile.rb +158 -0
- data/tasks/test.rb +0 -6
- data/test/css/test_xpath_visitor.rb +9 -0
- data/test/helper.rb +49 -11
- data/test/html/sax/test_parser.rb +11 -1
- data/test/html/test_document.rb +8 -0
- data/test/html/test_document_fragment.rb +14 -2
- data/test/html/test_element_description.rb +5 -1
- data/test/html/test_node.rb +5 -66
- data/test/test_reader.rb +28 -0
- data/test/test_xslt_transforms.rb +14 -0
- data/test/xml/test_builder.rb +43 -0
- data/test/xml/test_cdata.rb +12 -0
- data/test/xml/test_document.rb +74 -39
- data/test/xml/test_document_fragment.rb +36 -0
- data/test/xml/test_entity_decl.rb +37 -0
- data/test/xml/test_node.rb +192 -65
- data/test/xml/test_node_reparenting.rb +253 -236
- data/test/xml/test_node_set.rb +67 -0
- data/test/xml/test_text.rb +8 -0
- data/test/xml/test_xpath.rb +32 -0
- metadata +151 -79
- data/ext/nokogiri/iconv.dll +0 -0
- data/ext/nokogiri/libexslt.dll +0 -0
- data/ext/nokogiri/libxml2.dll +0 -0
- data/ext/nokogiri/libxslt.dll +0 -0
- data/ext/nokogiri/xml_xpath.c +0 -53
- data/ext/nokogiri/xml_xpath.h +0 -11
- data/ext/nokogiri/zlib1.dll +0 -0
- data/lib/nokogiri/xml/fragment_handler.rb +0 -79
data/ext/nokogiri/iconv.dll
DELETED
Binary file
|
data/ext/nokogiri/libexslt.dll
DELETED
Binary file
|
data/ext/nokogiri/libxml2.dll
DELETED
Binary file
|
data/ext/nokogiri/libxslt.dll
DELETED
Binary file
|
data/ext/nokogiri/xml_xpath.c
DELETED
@@ -1,53 +0,0 @@
|
|
1
|
-
#include <xml_xpath.h>
|
2
|
-
|
3
|
-
static void deallocate(xmlXPathObjectPtr xpath)
|
4
|
-
{
|
5
|
-
NOKOGIRI_DEBUG_START(xpath);
|
6
|
-
xmlXPathFreeNodeSetList(xpath); // despite the name, this frees the xpath but not the contained node set
|
7
|
-
NOKOGIRI_DEBUG_END(xpath);
|
8
|
-
}
|
9
|
-
|
10
|
-
VALUE Nokogiri_wrap_xml_xpath(xmlXPathObjectPtr xpath)
|
11
|
-
{
|
12
|
-
return Data_Wrap_Struct(cNokogiriXmlXpath, 0, deallocate, xpath);
|
13
|
-
}
|
14
|
-
|
15
|
-
/*
|
16
|
-
* call-seq:
|
17
|
-
* node_set
|
18
|
-
*
|
19
|
-
* Fetch the node set associated with this xpath context.
|
20
|
-
*/
|
21
|
-
static VALUE node_set(VALUE self)
|
22
|
-
{
|
23
|
-
xmlXPathObjectPtr xpath;
|
24
|
-
Data_Get_Struct(self, xmlXPathObject, xpath);
|
25
|
-
|
26
|
-
VALUE node_set = Qnil;
|
27
|
-
|
28
|
-
if (xpath->nodesetval)
|
29
|
-
node_set = Nokogiri_wrap_xml_node_set(xpath->nodesetval);
|
30
|
-
|
31
|
-
if(NIL_P(node_set))
|
32
|
-
node_set = Nokogiri_wrap_xml_node_set(xmlXPathNodeSetCreate(NULL));
|
33
|
-
|
34
|
-
rb_funcall(node_set, rb_intern("document="), 1, rb_iv_get(self, "@document"));
|
35
|
-
|
36
|
-
return node_set;
|
37
|
-
}
|
38
|
-
|
39
|
-
VALUE cNokogiriXmlXpath;
|
40
|
-
void init_xml_xpath(void)
|
41
|
-
{
|
42
|
-
VALUE module = rb_define_module("Nokogiri");
|
43
|
-
VALUE xml = rb_define_module_under(module, "XML");
|
44
|
-
|
45
|
-
/*
|
46
|
-
* This class wraps an XPath object and should only be instantiated from
|
47
|
-
* XPathContext.
|
48
|
-
*/
|
49
|
-
VALUE klass = rb_define_class_under(xml, "XPath", rb_cObject);
|
50
|
-
|
51
|
-
cNokogiriXmlXpath = klass;
|
52
|
-
rb_define_method(klass, "node_set", node_set, 0);
|
53
|
-
}
|
data/ext/nokogiri/xml_xpath.h
DELETED
data/ext/nokogiri/zlib1.dll
DELETED
Binary file
|
@@ -1,79 +0,0 @@
|
|
1
|
-
module Nokogiri
|
2
|
-
module XML
|
3
|
-
class FragmentHandler < Nokogiri::XML::SAX::Document # :nodoc:
|
4
|
-
QNAME_REGEX = /(.*):(.*)/
|
5
|
-
|
6
|
-
def initialize node, original_html
|
7
|
-
@doc_started = false
|
8
|
-
@document = node.document
|
9
|
-
@stack = [node]
|
10
|
-
@html_eh = node.kind_of? HTML::DocumentFragment
|
11
|
-
@original_html = prepare_for_regex(original_html.strip)
|
12
|
-
end
|
13
|
-
|
14
|
-
def start_element name, attrs = []
|
15
|
-
regex = @html_eh ? %r{^\s*<#{Regexp.escape(name)}}i :
|
16
|
-
%r{^\s*<#{Regexp.escape(name)}}
|
17
|
-
|
18
|
-
if ! @doc_started && @original_html =~ regex
|
19
|
-
@doc_started = true
|
20
|
-
end
|
21
|
-
return unless @doc_started
|
22
|
-
|
23
|
-
ns = nil
|
24
|
-
if @document.root
|
25
|
-
match = name.match(QNAME_REGEX)
|
26
|
-
if match
|
27
|
-
prefix, name = match[1], match[2]
|
28
|
-
ns = @document.root.namespace_definitions.detect { |x|
|
29
|
-
x.prefix == prefix
|
30
|
-
}
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
node = Element.new(name, @document)
|
35
|
-
attrs << "" unless (attrs.length % 2) == 0
|
36
|
-
Hash[*attrs].each do |k,v|
|
37
|
-
node[k] = v
|
38
|
-
end
|
39
|
-
|
40
|
-
node.namespace = ns if ns
|
41
|
-
|
42
|
-
@stack.last << node
|
43
|
-
@stack << node
|
44
|
-
end
|
45
|
-
|
46
|
-
def characters string
|
47
|
-
@doc_started = true
|
48
|
-
@stack.last << Text.new(string, @document)
|
49
|
-
end
|
50
|
-
|
51
|
-
def comment string
|
52
|
-
@stack.last << Comment.new(@document, string)
|
53
|
-
end
|
54
|
-
|
55
|
-
def cdata_block string
|
56
|
-
@stack.last << CDATA.new(@document, string)
|
57
|
-
end
|
58
|
-
|
59
|
-
def end_element name
|
60
|
-
return unless @stack.last.name == name
|
61
|
-
@stack.pop
|
62
|
-
end
|
63
|
-
|
64
|
-
private
|
65
|
-
|
66
|
-
#
|
67
|
-
# the regexes used in start_element() and characters() anchor at
|
68
|
-
# start-of-line, but we really only want them to anchor at
|
69
|
-
# start-of-doc. so let's only save up to the first newline.
|
70
|
-
#
|
71
|
-
# this implementation choice was the result of some benchmarks, if
|
72
|
-
# you're curious: http://gist.github.com/115936
|
73
|
-
#
|
74
|
-
def prepare_for_regex(string)
|
75
|
-
(newline_index = string.index("\n")) ? string.slice(0,newline_index) : string
|
76
|
-
end
|
77
|
-
end
|
78
|
-
end
|
79
|
-
end
|