nokogiri 1.5.10 → 1.13.0
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 +7 -0
- data/Gemfile +5 -0
- data/LICENSE-DEPENDENCIES.md +1903 -0
- data/LICENSE.md +9 -0
- data/README.md +280 -0
- data/bin/nokogiri +84 -31
- data/dependencies.yml +73 -0
- data/ext/nokogiri/depend +38 -358
- data/ext/nokogiri/extconf.rb +956 -100
- data/ext/nokogiri/gumbo.c +584 -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 +120 -0
- data/ext/nokogiri/html4_sax_push_parser.c +95 -0
- data/ext/nokogiri/libxml2_backwards_compat.c +121 -0
- data/ext/nokogiri/nokogiri.c +232 -87
- data/ext/nokogiri/nokogiri.h +188 -129
- data/ext/nokogiri/test_global_handlers.c +40 -0
- data/ext/nokogiri/xml_attr.c +49 -40
- data/ext/nokogiri/xml_attribute_decl.c +18 -18
- data/ext/nokogiri/xml_cdata.c +24 -23
- data/ext/nokogiri/xml_comment.c +29 -21
- data/ext/nokogiri/xml_document.c +327 -223
- data/ext/nokogiri/xml_document_fragment.c +12 -16
- data/ext/nokogiri/xml_dtd.c +56 -50
- data/ext/nokogiri/xml_element_content.c +31 -26
- data/ext/nokogiri/xml_element_decl.c +22 -22
- data/ext/nokogiri/xml_encoding_handler.c +45 -20
- data/ext/nokogiri/xml_entity_decl.c +32 -30
- data/ext/nokogiri/xml_entity_reference.c +16 -18
- data/ext/nokogiri/xml_namespace.c +74 -32
- data/ext/nokogiri/xml_node.c +1290 -680
- data/ext/nokogiri/xml_node_set.c +239 -208
- data/ext/nokogiri/xml_processing_instruction.c +17 -19
- data/ext/nokogiri/xml_reader.c +227 -189
- data/ext/nokogiri/xml_relax_ng.c +52 -28
- data/ext/nokogiri/xml_sax_parser.c +123 -125
- data/ext/nokogiri/xml_sax_parser_context.c +138 -79
- data/ext/nokogiri/xml_sax_push_parser.c +88 -35
- data/ext/nokogiri/xml_schema.c +112 -33
- data/ext/nokogiri/xml_syntax_error.c +50 -23
- data/ext/nokogiri/xml_text.c +14 -18
- data/ext/nokogiri/xml_xpath_context.c +227 -140
- data/ext/nokogiri/xslt_stylesheet.c +162 -168
- data/gumbo-parser/CHANGES.md +63 -0
- data/gumbo-parser/Makefile +101 -0
- data/gumbo-parser/THANKS +27 -0
- data/gumbo-parser/src/Makefile +34 -0
- data/gumbo-parser/src/README.md +41 -0
- data/gumbo-parser/src/ascii.c +75 -0
- data/gumbo-parser/src/ascii.h +115 -0
- data/gumbo-parser/src/attribute.c +42 -0
- data/gumbo-parser/src/attribute.h +17 -0
- data/gumbo-parser/src/char_ref.c +22225 -0
- data/gumbo-parser/src/char_ref.h +29 -0
- data/gumbo-parser/src/char_ref.rl +2154 -0
- data/gumbo-parser/src/error.c +626 -0
- data/gumbo-parser/src/error.h +148 -0
- data/gumbo-parser/src/foreign_attrs.c +104 -0
- data/gumbo-parser/src/foreign_attrs.gperf +27 -0
- data/gumbo-parser/src/gumbo.h +943 -0
- data/gumbo-parser/src/insertion_mode.h +33 -0
- data/gumbo-parser/src/macros.h +91 -0
- data/gumbo-parser/src/parser.c +4875 -0
- data/gumbo-parser/src/parser.h +41 -0
- data/gumbo-parser/src/replacement.h +33 -0
- data/gumbo-parser/src/string_buffer.c +103 -0
- data/gumbo-parser/src/string_buffer.h +68 -0
- data/gumbo-parser/src/string_piece.c +48 -0
- data/gumbo-parser/src/svg_attrs.c +174 -0
- data/gumbo-parser/src/svg_attrs.gperf +77 -0
- data/gumbo-parser/src/svg_tags.c +137 -0
- data/gumbo-parser/src/svg_tags.gperf +55 -0
- data/gumbo-parser/src/tag.c +222 -0
- data/gumbo-parser/src/tag_lookup.c +382 -0
- data/gumbo-parser/src/tag_lookup.gperf +169 -0
- data/gumbo-parser/src/tag_lookup.h +13 -0
- data/gumbo-parser/src/token_buffer.c +79 -0
- data/gumbo-parser/src/token_buffer.h +71 -0
- data/gumbo-parser/src/token_type.h +17 -0
- data/gumbo-parser/src/tokenizer.c +3463 -0
- data/gumbo-parser/src/tokenizer.h +112 -0
- data/gumbo-parser/src/tokenizer_states.h +339 -0
- data/gumbo-parser/src/utf8.c +245 -0
- data/gumbo-parser/src/utf8.h +164 -0
- data/gumbo-parser/src/util.c +68 -0
- data/gumbo-parser/src/util.h +30 -0
- data/gumbo-parser/src/vector.c +111 -0
- data/gumbo-parser/src/vector.h +45 -0
- data/lib/nokogiri/class_resolver.rb +67 -0
- data/lib/nokogiri/css/node.rb +10 -58
- data/lib/nokogiri/css/parser.rb +327 -288
- data/lib/nokogiri/css/parser.y +67 -45
- data/lib/nokogiri/css/parser_extras.rb +52 -49
- data/lib/nokogiri/css/syntax_error.rb +3 -1
- data/lib/nokogiri/css/tokenizer.rb +107 -104
- data/lib/nokogiri/css/tokenizer.rex +7 -6
- data/lib/nokogiri/css/xpath_visitor.rb +263 -75
- data/lib/nokogiri/css.rb +50 -17
- data/lib/nokogiri/decorators/slop.rb +17 -8
- data/lib/nokogiri/extension.rb +31 -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 +331 -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 +578 -0
- data/lib/nokogiri/{html → html4}/entity_lookup.rb +4 -2
- data/lib/nokogiri/{html → html4}/sax/parser.rb +24 -15
- data/lib/nokogiri/html4/sax/parser_context.rb +20 -0
- data/lib/nokogiri/html4/sax/push_parser.rb +37 -0
- data/lib/nokogiri/html4.rb +46 -0
- data/lib/nokogiri/html5/document.rb +88 -0
- data/lib/nokogiri/html5/document_fragment.rb +83 -0
- data/lib/nokogiri/html5/node.rb +96 -0
- data/lib/nokogiri/html5.rb +477 -0
- data/lib/nokogiri/jruby/dependencies.rb +21 -0
- data/lib/nokogiri/syntax_error.rb +2 -0
- data/lib/nokogiri/version/constant.rb +6 -0
- data/lib/nokogiri/version/info.rb +221 -0
- data/lib/nokogiri/version.rb +3 -90
- data/lib/nokogiri/xml/attr.rb +6 -3
- data/lib/nokogiri/xml/attribute_decl.rb +3 -1
- data/lib/nokogiri/xml/builder.rb +96 -54
- data/lib/nokogiri/xml/cdata.rb +3 -1
- data/lib/nokogiri/xml/character_data.rb +2 -0
- data/lib/nokogiri/xml/document.rb +234 -95
- data/lib/nokogiri/xml/document_fragment.rb +86 -36
- data/lib/nokogiri/xml/dtd.rb +16 -4
- 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 +20 -0
- data/lib/nokogiri/xml/namespace.rb +3 -0
- data/lib/nokogiri/xml/node/save_options.rb +8 -4
- data/lib/nokogiri/xml/node.rb +947 -502
- data/lib/nokogiri/xml/node_set.rb +168 -159
- data/lib/nokogiri/xml/notation.rb +13 -0
- data/lib/nokogiri/xml/parse_options.rb +40 -5
- data/lib/nokogiri/xml/pp/character_data.rb +9 -6
- data/lib/nokogiri/xml/pp/node.rb +25 -26
- data/lib/nokogiri/xml/pp.rb +4 -2
- data/lib/nokogiri/xml/processing_instruction.rb +3 -1
- data/lib/nokogiri/xml/reader.rb +23 -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 +43 -41
- 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 +259 -0
- data/lib/nokogiri/xml/syntax_error.rb +25 -1
- 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 -36
- data/lib/nokogiri/xslt/stylesheet.rb +3 -1
- data/lib/nokogiri/xslt.rb +18 -16
- data/lib/nokogiri.rb +69 -69
- data/lib/xsd/xmlparser/nokogiri.rb +26 -24
- data/patches/libxml2/0001-Remove-script-macro-support.patch +40 -0
- data/patches/libxml2/0002-Update-entities-to-remove-handling-of-ssi.patch +44 -0
- data/patches/libxml2/0003-libxml2.la-is-in-top_builddir.patch +25 -0
- data/patches/libxml2/0004-use-glibc-strlen.patch +53 -0
- data/patches/libxml2/0005-avoid-isnan-isinf.patch +81 -0
- data/patches/libxml2/0006-update-automake-files-for-arm64.patch +2511 -0
- data/patches/libxml2/0007-Fix-XPath-recursion-limit.patch +31 -0
- data/patches/libxml2/0008-htmlParseComment-handle-abruptly-closed-comments.patch +61 -0
- data/patches/libxml2/0009-allow-wildcard-namespaces.patch +77 -0
- data/patches/libxslt/0001-update-automake-files-for-arm64.patch +2511 -0
- data/patches/libxslt/0002-Fix-xml2-config-check-in-configure-script.patch +19 -0
- data/ports/archives/libxml2-2.9.12.tar.gz +0 -0
- data/ports/archives/libxslt-1.1.34.tar.gz +0 -0
- metadata +382 -460
- data/.autotest +0 -26
- data/.gemtest +0 -0
- data/CHANGELOG.ja.rdoc +0 -785
- data/CHANGELOG.rdoc +0 -783
- data/C_CODING_STYLE.rdoc +0 -33
- data/Manifest.txt +0 -303
- data/README.ja.rdoc +0 -106
- data/README.rdoc +0 -175
- data/ROADMAP.md +0 -90
- data/Rakefile +0 -228
- data/STANDARD_RESPONSES.md +0 -47
- data/Y_U_NO_GEMSPEC.md +0 -155
- data/build_all +0 -105
- 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 -56
- 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 -13
- data/ext/nokogiri/xml_node.h +0 -13
- data/ext/nokogiri/xml_node_set.h +0 -14
- 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 -254
- data/lib/nokogiri/html/document_fragment.rb +0 -41
- data/lib/nokogiri/html/element_description_defaults.rb +0 -671
- data/lib/nokogiri/html/sax/parser_context.rb +0 -16
- data/lib/nokogiri/html/sax/push_parser.rb +0 -16
- data/tasks/cross_compile.rb +0 -150
- data/tasks/nokogiri.org.rb +0 -24
- data/tasks/test.rb +0 -95
- data/test/css/test_nthiness.rb +0 -159
- data/test/css/test_parser.rb +0 -341
- data/test/css/test_tokenizer.rb +0 -198
- data/test/css/test_xpath_visitor.rb +0 -91
- data/test/decorators/test_slop.rb +0 -16
- data/test/files/2ch.html +0 -108
- data/test/files/address_book.rlx +0 -12
- data/test/files/address_book.xml +0 -10
- data/test/files/bar/bar.xsd +0 -4
- data/test/files/dont_hurt_em_why.xml +0 -422
- data/test/files/encoding.html +0 -82
- data/test/files/encoding.xhtml +0 -84
- data/test/files/exslt.xml +0 -8
- data/test/files/exslt.xslt +0 -35
- data/test/files/foo/foo.xsd +0 -4
- data/test/files/metacharset.html +0 -10
- data/test/files/noencoding.html +0 -47
- data/test/files/po.xml +0 -32
- data/test/files/po.xsd +0 -66
- data/test/files/shift_jis.html +0 -10
- data/test/files/shift_jis.xml +0 -5
- data/test/files/snuggles.xml +0 -3
- data/test/files/staff.dtd +0 -10
- data/test/files/staff.xml +0 -59
- data/test/files/staff.xslt +0 -32
- data/test/files/test_document_url/bar.xml +0 -2
- data/test/files/test_document_url/document.dtd +0 -4
- data/test/files/test_document_url/document.xml +0 -6
- data/test/files/tlm.html +0 -850
- data/test/files/to_be_xincluded.xml +0 -2
- data/test/files/valid_bar.xml +0 -2
- data/test/files/xinclude.xml +0 -4
- data/test/helper.rb +0 -154
- data/test/html/sax/test_parser.rb +0 -141
- data/test/html/sax/test_parser_context.rb +0 -46
- data/test/html/test_builder.rb +0 -164
- data/test/html/test_document.rb +0 -552
- data/test/html/test_document_encoding.rb +0 -138
- data/test/html/test_document_fragment.rb +0 -261
- data/test/html/test_element_description.rb +0 -105
- data/test/html/test_named_characters.rb +0 -14
- data/test/html/test_node.rb +0 -196
- data/test/html/test_node_encoding.rb +0 -27
- data/test/namespaces/test_additional_namespaces_in_builder_doc.rb +0 -14
- data/test/namespaces/test_namespaces_in_builder_doc.rb +0 -75
- data/test/namespaces/test_namespaces_in_created_doc.rb +0 -75
- data/test/namespaces/test_namespaces_in_parsed_doc.rb +0 -66
- data/test/test_convert_xpath.rb +0 -135
- data/test/test_css_cache.rb +0 -45
- data/test/test_encoding_handler.rb +0 -46
- data/test/test_memory_leak.rb +0 -156
- data/test/test_nokogiri.rb +0 -132
- data/test/test_reader.rb +0 -555
- data/test/test_soap4r_sax.rb +0 -52
- data/test/test_xslt_transforms.rb +0 -254
- data/test/xml/node/test_save_options.rb +0 -28
- data/test/xml/node/test_subclass.rb +0 -44
- data/test/xml/sax/test_parser.rb +0 -366
- data/test/xml/sax/test_parser_context.rb +0 -106
- data/test/xml/sax/test_push_parser.rb +0 -157
- data/test/xml/test_attr.rb +0 -64
- data/test/xml/test_attribute_decl.rb +0 -86
- data/test/xml/test_builder.rb +0 -306
- data/test/xml/test_c14n.rb +0 -151
- data/test/xml/test_cdata.rb +0 -48
- data/test/xml/test_comment.rb +0 -29
- data/test/xml/test_document.rb +0 -828
- data/test/xml/test_document_encoding.rb +0 -28
- data/test/xml/test_document_fragment.rb +0 -223
- data/test/xml/test_dtd.rb +0 -103
- data/test/xml/test_dtd_encoding.rb +0 -33
- data/test/xml/test_element_content.rb +0 -56
- data/test/xml/test_element_decl.rb +0 -73
- data/test/xml/test_entity_decl.rb +0 -122
- data/test/xml/test_entity_reference.rb +0 -245
- data/test/xml/test_namespace.rb +0 -95
- data/test/xml/test_node.rb +0 -1137
- data/test/xml/test_node_attributes.rb +0 -96
- data/test/xml/test_node_encoding.rb +0 -107
- data/test/xml/test_node_inheritance.rb +0 -32
- data/test/xml/test_node_reparenting.rb +0 -374
- data/test/xml/test_node_set.rb +0 -755
- data/test/xml/test_parse_options.rb +0 -64
- data/test/xml/test_processing_instruction.rb +0 -30
- data/test/xml/test_reader_encoding.rb +0 -142
- data/test/xml/test_relax_ng.rb +0 -60
- data/test/xml/test_schema.rb +0 -103
- data/test/xml/test_syntax_error.rb +0 -12
- data/test/xml/test_text.rb +0 -45
- data/test/xml/test_unparented_node.rb +0 -422
- data/test/xml/test_xinclude.rb +0 -83
- data/test/xml/test_xpath.rb +0 -295
- data/test/xslt/test_custom_functions.rb +0 -133
- data/test/xslt/test_exception_handling.rb +0 -37
- data/test_all +0 -81
data/C_CODING_STYLE.rdoc
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
= C/C++ mode style for Nokogiri
|
2
|
-
|
3
|
-
Please don't propose commits that only change whitespace. However, if your
|
4
|
-
commit touches a function or section that is not using MRI Ruby conventions,
|
5
|
-
feel free to update whitespace in the surrounding code.
|
6
|
-
|
7
|
-
|
8
|
-
= WHITESPACE:
|
9
|
-
|
10
|
-
* indent level: 2
|
11
|
-
* indent type: Always spaces
|
12
|
-
* line Breaks: LF
|
13
|
-
|
14
|
-
This style can be automatically applied by running:
|
15
|
-
|
16
|
-
astyle --indent=spaces=2 --style=1tbs --keep-one-line-blocks $(ack -f --type=cpp --type=cc ext/nokogiri)
|
17
|
-
|
18
|
-
|
19
|
-
= FUNCTION DECLARATION:
|
20
|
-
|
21
|
-
ANSI C style:
|
22
|
-
|
23
|
-
type name(args)
|
24
|
-
{
|
25
|
-
declarations
|
26
|
-
|
27
|
-
code
|
28
|
-
}
|
29
|
-
|
30
|
-
= SOURCES:
|
31
|
-
|
32
|
-
* <3<3<3
|
33
|
-
|
data/Manifest.txt
DELETED
@@ -1,303 +0,0 @@
|
|
1
|
-
.autotest
|
2
|
-
.gemtest
|
3
|
-
CHANGELOG.ja.rdoc
|
4
|
-
CHANGELOG.rdoc
|
5
|
-
C_CODING_STYLE.rdoc
|
6
|
-
Manifest.txt
|
7
|
-
README.ja.rdoc
|
8
|
-
README.rdoc
|
9
|
-
ROADMAP.md
|
10
|
-
Rakefile
|
11
|
-
STANDARD_RESPONSES.md
|
12
|
-
Y_U_NO_GEMSPEC.md
|
13
|
-
bin/nokogiri
|
14
|
-
build_all
|
15
|
-
ext/java/nokogiri/EncodingHandler.java
|
16
|
-
ext/java/nokogiri/HtmlDocument.java
|
17
|
-
ext/java/nokogiri/HtmlElementDescription.java
|
18
|
-
ext/java/nokogiri/HtmlEntityLookup.java
|
19
|
-
ext/java/nokogiri/HtmlSaxParserContext.java
|
20
|
-
ext/java/nokogiri/NokogiriService.java
|
21
|
-
ext/java/nokogiri/XmlAttr.java
|
22
|
-
ext/java/nokogiri/XmlAttributeDecl.java
|
23
|
-
ext/java/nokogiri/XmlCdata.java
|
24
|
-
ext/java/nokogiri/XmlComment.java
|
25
|
-
ext/java/nokogiri/XmlDocument.java
|
26
|
-
ext/java/nokogiri/XmlDocumentFragment.java
|
27
|
-
ext/java/nokogiri/XmlDtd.java
|
28
|
-
ext/java/nokogiri/XmlElement.java
|
29
|
-
ext/java/nokogiri/XmlElementContent.java
|
30
|
-
ext/java/nokogiri/XmlElementDecl.java
|
31
|
-
ext/java/nokogiri/XmlEntityDecl.java
|
32
|
-
ext/java/nokogiri/XmlEntityReference.java
|
33
|
-
ext/java/nokogiri/XmlNamespace.java
|
34
|
-
ext/java/nokogiri/XmlNode.java
|
35
|
-
ext/java/nokogiri/XmlNodeSet.java
|
36
|
-
ext/java/nokogiri/XmlProcessingInstruction.java
|
37
|
-
ext/java/nokogiri/XmlReader.java
|
38
|
-
ext/java/nokogiri/XmlRelaxng.java
|
39
|
-
ext/java/nokogiri/XmlSaxParserContext.java
|
40
|
-
ext/java/nokogiri/XmlSaxPushParser.java
|
41
|
-
ext/java/nokogiri/XmlSchema.java
|
42
|
-
ext/java/nokogiri/XmlSyntaxError.java
|
43
|
-
ext/java/nokogiri/XmlText.java
|
44
|
-
ext/java/nokogiri/XmlXpathContext.java
|
45
|
-
ext/java/nokogiri/XsltStylesheet.java
|
46
|
-
ext/java/nokogiri/internals/ClosedStreamException.java
|
47
|
-
ext/java/nokogiri/internals/HtmlDomParserContext.java
|
48
|
-
ext/java/nokogiri/internals/NokogiriBlockingQueueInputStream.java
|
49
|
-
ext/java/nokogiri/internals/NokogiriDocumentCache.java
|
50
|
-
ext/java/nokogiri/internals/NokogiriDomParser.java
|
51
|
-
ext/java/nokogiri/internals/NokogiriEncodingReaderWrapper.java
|
52
|
-
ext/java/nokogiri/internals/NokogiriEntityResolver.java
|
53
|
-
ext/java/nokogiri/internals/NokogiriErrorHandler.java
|
54
|
-
ext/java/nokogiri/internals/NokogiriHandler.java
|
55
|
-
ext/java/nokogiri/internals/NokogiriHelpers.java
|
56
|
-
ext/java/nokogiri/internals/NokogiriNamespaceCache.java
|
57
|
-
ext/java/nokogiri/internals/NokogiriNamespaceContext.java
|
58
|
-
ext/java/nokogiri/internals/NokogiriNonStrictErrorHandler.java
|
59
|
-
ext/java/nokogiri/internals/NokogiriNonStrictErrorHandler4NekoHtml.java
|
60
|
-
ext/java/nokogiri/internals/NokogiriStrictErrorHandler.java
|
61
|
-
ext/java/nokogiri/internals/NokogiriXPathFunction.java
|
62
|
-
ext/java/nokogiri/internals/NokogiriXPathFunctionResolver.java
|
63
|
-
ext/java/nokogiri/internals/NokogiriXPathVariableResolver.java
|
64
|
-
ext/java/nokogiri/internals/NokogiriXsltErrorListener.java
|
65
|
-
ext/java/nokogiri/internals/ParserContext.java
|
66
|
-
ext/java/nokogiri/internals/ReaderNode.java
|
67
|
-
ext/java/nokogiri/internals/SaveContextVisitor.java
|
68
|
-
ext/java/nokogiri/internals/SchemaErrorHandler.java
|
69
|
-
ext/java/nokogiri/internals/UncloseableInputStream.java
|
70
|
-
ext/java/nokogiri/internals/XmlDeclHandler.java
|
71
|
-
ext/java/nokogiri/internals/XmlDomParserContext.java
|
72
|
-
ext/java/nokogiri/internals/XmlSaxParser.java
|
73
|
-
ext/java/nokogiri/internals/XsltExtensionFunction.java
|
74
|
-
ext/nokogiri/depend
|
75
|
-
ext/nokogiri/extconf.rb
|
76
|
-
ext/nokogiri/html_document.c
|
77
|
-
ext/nokogiri/html_document.h
|
78
|
-
ext/nokogiri/html_element_description.c
|
79
|
-
ext/nokogiri/html_element_description.h
|
80
|
-
ext/nokogiri/html_entity_lookup.c
|
81
|
-
ext/nokogiri/html_entity_lookup.h
|
82
|
-
ext/nokogiri/html_sax_parser_context.c
|
83
|
-
ext/nokogiri/html_sax_parser_context.h
|
84
|
-
ext/nokogiri/html_sax_push_parser.c
|
85
|
-
ext/nokogiri/html_sax_push_parser.h
|
86
|
-
ext/nokogiri/nokogiri.c
|
87
|
-
ext/nokogiri/nokogiri.h
|
88
|
-
ext/nokogiri/xml_attr.c
|
89
|
-
ext/nokogiri/xml_attr.h
|
90
|
-
ext/nokogiri/xml_attribute_decl.c
|
91
|
-
ext/nokogiri/xml_attribute_decl.h
|
92
|
-
ext/nokogiri/xml_cdata.c
|
93
|
-
ext/nokogiri/xml_cdata.h
|
94
|
-
ext/nokogiri/xml_comment.c
|
95
|
-
ext/nokogiri/xml_comment.h
|
96
|
-
ext/nokogiri/xml_document.c
|
97
|
-
ext/nokogiri/xml_document.h
|
98
|
-
ext/nokogiri/xml_document_fragment.c
|
99
|
-
ext/nokogiri/xml_document_fragment.h
|
100
|
-
ext/nokogiri/xml_dtd.c
|
101
|
-
ext/nokogiri/xml_dtd.h
|
102
|
-
ext/nokogiri/xml_element_content.c
|
103
|
-
ext/nokogiri/xml_element_content.h
|
104
|
-
ext/nokogiri/xml_element_decl.c
|
105
|
-
ext/nokogiri/xml_element_decl.h
|
106
|
-
ext/nokogiri/xml_encoding_handler.c
|
107
|
-
ext/nokogiri/xml_encoding_handler.h
|
108
|
-
ext/nokogiri/xml_entity_decl.c
|
109
|
-
ext/nokogiri/xml_entity_decl.h
|
110
|
-
ext/nokogiri/xml_entity_reference.c
|
111
|
-
ext/nokogiri/xml_entity_reference.h
|
112
|
-
ext/nokogiri/xml_io.c
|
113
|
-
ext/nokogiri/xml_io.h
|
114
|
-
ext/nokogiri/xml_libxml2_hacks.c
|
115
|
-
ext/nokogiri/xml_libxml2_hacks.h
|
116
|
-
ext/nokogiri/xml_namespace.c
|
117
|
-
ext/nokogiri/xml_namespace.h
|
118
|
-
ext/nokogiri/xml_node.c
|
119
|
-
ext/nokogiri/xml_node.h
|
120
|
-
ext/nokogiri/xml_node_set.c
|
121
|
-
ext/nokogiri/xml_node_set.h
|
122
|
-
ext/nokogiri/xml_processing_instruction.c
|
123
|
-
ext/nokogiri/xml_processing_instruction.h
|
124
|
-
ext/nokogiri/xml_reader.c
|
125
|
-
ext/nokogiri/xml_reader.h
|
126
|
-
ext/nokogiri/xml_relax_ng.c
|
127
|
-
ext/nokogiri/xml_relax_ng.h
|
128
|
-
ext/nokogiri/xml_sax_parser.c
|
129
|
-
ext/nokogiri/xml_sax_parser.h
|
130
|
-
ext/nokogiri/xml_sax_parser_context.c
|
131
|
-
ext/nokogiri/xml_sax_parser_context.h
|
132
|
-
ext/nokogiri/xml_sax_push_parser.c
|
133
|
-
ext/nokogiri/xml_sax_push_parser.h
|
134
|
-
ext/nokogiri/xml_schema.c
|
135
|
-
ext/nokogiri/xml_schema.h
|
136
|
-
ext/nokogiri/xml_syntax_error.c
|
137
|
-
ext/nokogiri/xml_syntax_error.h
|
138
|
-
ext/nokogiri/xml_text.c
|
139
|
-
ext/nokogiri/xml_text.h
|
140
|
-
ext/nokogiri/xml_xpath_context.c
|
141
|
-
ext/nokogiri/xml_xpath_context.h
|
142
|
-
ext/nokogiri/xslt_stylesheet.c
|
143
|
-
ext/nokogiri/xslt_stylesheet.h
|
144
|
-
lib/isorelax.jar
|
145
|
-
lib/jing.jar
|
146
|
-
lib/nekodtd.jar
|
147
|
-
lib/nekohtml.jar
|
148
|
-
lib/nokogiri.rb
|
149
|
-
lib/nokogiri/css.rb
|
150
|
-
lib/nokogiri/css/node.rb
|
151
|
-
lib/nokogiri/css/parser.rb
|
152
|
-
lib/nokogiri/css/parser.y
|
153
|
-
lib/nokogiri/css/parser_extras.rb
|
154
|
-
lib/nokogiri/css/syntax_error.rb
|
155
|
-
lib/nokogiri/css/tokenizer.rb
|
156
|
-
lib/nokogiri/css/tokenizer.rex
|
157
|
-
lib/nokogiri/css/xpath_visitor.rb
|
158
|
-
lib/nokogiri/decorators/slop.rb
|
159
|
-
lib/nokogiri/html.rb
|
160
|
-
lib/nokogiri/html/builder.rb
|
161
|
-
lib/nokogiri/html/document.rb
|
162
|
-
lib/nokogiri/html/document_fragment.rb
|
163
|
-
lib/nokogiri/html/element_description.rb
|
164
|
-
lib/nokogiri/html/element_description_defaults.rb
|
165
|
-
lib/nokogiri/html/entity_lookup.rb
|
166
|
-
lib/nokogiri/html/sax/parser.rb
|
167
|
-
lib/nokogiri/html/sax/parser_context.rb
|
168
|
-
lib/nokogiri/html/sax/push_parser.rb
|
169
|
-
lib/nokogiri/syntax_error.rb
|
170
|
-
lib/nokogiri/version.rb
|
171
|
-
lib/nokogiri/xml.rb
|
172
|
-
lib/nokogiri/xml/attr.rb
|
173
|
-
lib/nokogiri/xml/attribute_decl.rb
|
174
|
-
lib/nokogiri/xml/builder.rb
|
175
|
-
lib/nokogiri/xml/cdata.rb
|
176
|
-
lib/nokogiri/xml/character_data.rb
|
177
|
-
lib/nokogiri/xml/document.rb
|
178
|
-
lib/nokogiri/xml/document_fragment.rb
|
179
|
-
lib/nokogiri/xml/dtd.rb
|
180
|
-
lib/nokogiri/xml/element_content.rb
|
181
|
-
lib/nokogiri/xml/element_decl.rb
|
182
|
-
lib/nokogiri/xml/entity_decl.rb
|
183
|
-
lib/nokogiri/xml/namespace.rb
|
184
|
-
lib/nokogiri/xml/node.rb
|
185
|
-
lib/nokogiri/xml/node/save_options.rb
|
186
|
-
lib/nokogiri/xml/node_set.rb
|
187
|
-
lib/nokogiri/xml/notation.rb
|
188
|
-
lib/nokogiri/xml/parse_options.rb
|
189
|
-
lib/nokogiri/xml/pp.rb
|
190
|
-
lib/nokogiri/xml/pp/character_data.rb
|
191
|
-
lib/nokogiri/xml/pp/node.rb
|
192
|
-
lib/nokogiri/xml/processing_instruction.rb
|
193
|
-
lib/nokogiri/xml/reader.rb
|
194
|
-
lib/nokogiri/xml/relax_ng.rb
|
195
|
-
lib/nokogiri/xml/sax.rb
|
196
|
-
lib/nokogiri/xml/sax/document.rb
|
197
|
-
lib/nokogiri/xml/sax/parser.rb
|
198
|
-
lib/nokogiri/xml/sax/parser_context.rb
|
199
|
-
lib/nokogiri/xml/sax/push_parser.rb
|
200
|
-
lib/nokogiri/xml/schema.rb
|
201
|
-
lib/nokogiri/xml/syntax_error.rb
|
202
|
-
lib/nokogiri/xml/text.rb
|
203
|
-
lib/nokogiri/xml/xpath.rb
|
204
|
-
lib/nokogiri/xml/xpath/syntax_error.rb
|
205
|
-
lib/nokogiri/xml/xpath_context.rb
|
206
|
-
lib/nokogiri/xslt.rb
|
207
|
-
lib/nokogiri/xslt/stylesheet.rb
|
208
|
-
lib/xercesImpl.jar
|
209
|
-
lib/xsd/xmlparser/nokogiri.rb
|
210
|
-
tasks/cross_compile.rb
|
211
|
-
tasks/nokogiri.org.rb
|
212
|
-
tasks/test.rb
|
213
|
-
test/css/test_nthiness.rb
|
214
|
-
test/css/test_parser.rb
|
215
|
-
test/css/test_tokenizer.rb
|
216
|
-
test/css/test_xpath_visitor.rb
|
217
|
-
test/decorators/test_slop.rb
|
218
|
-
test/files/2ch.html
|
219
|
-
test/files/address_book.rlx
|
220
|
-
test/files/address_book.xml
|
221
|
-
test/files/bar/bar.xsd
|
222
|
-
test/files/dont_hurt_em_why.xml
|
223
|
-
test/files/encoding.html
|
224
|
-
test/files/encoding.xhtml
|
225
|
-
test/files/exslt.xml
|
226
|
-
test/files/exslt.xslt
|
227
|
-
test/files/foo/foo.xsd
|
228
|
-
test/files/metacharset.html
|
229
|
-
test/files/noencoding.html
|
230
|
-
test/files/po.xml
|
231
|
-
test/files/po.xsd
|
232
|
-
test/files/shift_jis.html
|
233
|
-
test/files/shift_jis.xml
|
234
|
-
test/files/snuggles.xml
|
235
|
-
test/files/staff.dtd
|
236
|
-
test/files/staff.xml
|
237
|
-
test/files/staff.xslt
|
238
|
-
test/files/test_document_url/bar.xml
|
239
|
-
test/files/test_document_url/document.dtd
|
240
|
-
test/files/test_document_url/document.xml
|
241
|
-
test/files/tlm.html
|
242
|
-
test/files/to_be_xincluded.xml
|
243
|
-
test/files/valid_bar.xml
|
244
|
-
test/files/xinclude.xml
|
245
|
-
test/helper.rb
|
246
|
-
test/html/sax/test_parser.rb
|
247
|
-
test/html/sax/test_parser_context.rb
|
248
|
-
test/html/test_builder.rb
|
249
|
-
test/html/test_document.rb
|
250
|
-
test/html/test_document_encoding.rb
|
251
|
-
test/html/test_document_fragment.rb
|
252
|
-
test/html/test_element_description.rb
|
253
|
-
test/html/test_named_characters.rb
|
254
|
-
test/html/test_node.rb
|
255
|
-
test/html/test_node_encoding.rb
|
256
|
-
test/test_convert_xpath.rb
|
257
|
-
test/test_css_cache.rb
|
258
|
-
test/test_encoding_handler.rb
|
259
|
-
test/test_memory_leak.rb
|
260
|
-
test/test_nokogiri.rb
|
261
|
-
test/test_reader.rb
|
262
|
-
test/test_soap4r_sax.rb
|
263
|
-
test/test_xslt_transforms.rb
|
264
|
-
test/xml/node/test_save_options.rb
|
265
|
-
test/xml/node/test_subclass.rb
|
266
|
-
test/xml/sax/test_parser.rb
|
267
|
-
test/xml/sax/test_parser_context.rb
|
268
|
-
test/xml/sax/test_push_parser.rb
|
269
|
-
test/xml/test_attr.rb
|
270
|
-
test/xml/test_attribute_decl.rb
|
271
|
-
test/xml/test_builder.rb
|
272
|
-
test/xml/test_c14n.rb
|
273
|
-
test/xml/test_cdata.rb
|
274
|
-
test/xml/test_comment.rb
|
275
|
-
test/xml/test_document.rb
|
276
|
-
test/xml/test_document_encoding.rb
|
277
|
-
test/xml/test_document_fragment.rb
|
278
|
-
test/xml/test_dtd.rb
|
279
|
-
test/xml/test_dtd_encoding.rb
|
280
|
-
test/xml/test_element_content.rb
|
281
|
-
test/xml/test_element_decl.rb
|
282
|
-
test/xml/test_entity_decl.rb
|
283
|
-
test/xml/test_entity_reference.rb
|
284
|
-
test/xml/test_namespace.rb
|
285
|
-
test/xml/test_node.rb
|
286
|
-
test/xml/test_node_attributes.rb
|
287
|
-
test/xml/test_node_encoding.rb
|
288
|
-
test/xml/test_node_inheritance.rb
|
289
|
-
test/xml/test_node_reparenting.rb
|
290
|
-
test/xml/test_node_set.rb
|
291
|
-
test/xml/test_parse_options.rb
|
292
|
-
test/xml/test_processing_instruction.rb
|
293
|
-
test/xml/test_reader_encoding.rb
|
294
|
-
test/xml/test_relax_ng.rb
|
295
|
-
test/xml/test_schema.rb
|
296
|
-
test/xml/test_syntax_error.rb
|
297
|
-
test/xml/test_text.rb
|
298
|
-
test/xml/test_unparented_node.rb
|
299
|
-
test/xml/test_xinclude.rb
|
300
|
-
test/xml/test_xpath.rb
|
301
|
-
test/xslt/test_custom_functions.rb
|
302
|
-
test/xslt/test_exception_handling.rb
|
303
|
-
test_all
|
data/README.ja.rdoc
DELETED
@@ -1,106 +0,0 @@
|
|
1
|
-
= Nokogiri (鋸) {<img src="https://secure.travis-ci.org/sparklemotion/nokogiri.png?rvm=1.9.3" />}[http://travis-ci.org/sparklemotion/nokogiri] {<img src="https://codeclimate.com/badge.png" />}[https://codeclimate.com/github/sparklemotion/nokogiri]
|
2
|
-
|
3
|
-
* http://nokogiri.org/
|
4
|
-
* http://github.com/sparklemotion/nokogiri/wikis
|
5
|
-
* http://github.com/sparklemotion/nokogiri/tree/master
|
6
|
-
* http://groups.google.com/group/nokogiri-list
|
7
|
-
* http://github.com/sparklemotion/nokogiri/issues
|
8
|
-
|
9
|
-
== DESCRIPTION:
|
10
|
-
|
11
|
-
Nokogiri はHTMLとXMLとSAXとXSLTとReaderのパーサーです。とりわけ重要な特徴は、
|
12
|
-
ドキュメントをXPathやCSS3セレクター経由で探索する機能を持つことです。
|
13
|
-
|
14
|
-
XMLは暴力に似ている - XMLが君の問題を解決しないとしたら、君はXMLを十分に
|
15
|
-
使いこなしていない事になる。
|
16
|
-
|
17
|
-
== FEATURES:
|
18
|
-
|
19
|
-
* XPath による探索
|
20
|
-
* CSS3 のセレクターによる探索
|
21
|
-
* XML/HTMLのビルダー
|
22
|
-
|
23
|
-
XML/HTMLの高速な解析と探索検索、ならびにCSS3セレクタとXPathをサポートしています。
|
24
|
-
|
25
|
-
== SUPPORT:
|
26
|
-
|
27
|
-
日本語でNokogiriの
|
28
|
-
{メーリングリスト}[http://groups.google.com/group/nokogiri-list]
|
29
|
-
|
30
|
-
* http://groups.google.com/group/nokogiri-list
|
31
|
-
|
32
|
-
{バグ報告}[http://github.com/sparklemotion/nokogiri/issues]
|
33
|
-
|
34
|
-
* http://github.com/sparklemotion/nokogiri/issues
|
35
|
-
|
36
|
-
IRCのチャンネルはfreenodeの #nokogiri です。
|
37
|
-
|
38
|
-
== SYNOPSIS:
|
39
|
-
|
40
|
-
require 'nokogiri'
|
41
|
-
require 'open-uri'
|
42
|
-
|
43
|
-
doc = Nokogiri::HTML(open('http://www.google.com/search?q=tenderlove'))
|
44
|
-
|
45
|
-
####
|
46
|
-
# Search for nodes by css
|
47
|
-
doc.css('h3.r a.l').each do |link|
|
48
|
-
puts link.content
|
49
|
-
end
|
50
|
-
|
51
|
-
####
|
52
|
-
# Search for nodes by xpath
|
53
|
-
doc.xpath('//h3/a[@class="l"]').each do |link|
|
54
|
-
puts link.content
|
55
|
-
end
|
56
|
-
|
57
|
-
####
|
58
|
-
# Or mix and match.
|
59
|
-
doc.search('h3.r a.l', '//h3/a[@class="l"]').each do |link|
|
60
|
-
puts link.content
|
61
|
-
end
|
62
|
-
|
63
|
-
|
64
|
-
== REQUIREMENTS:
|
65
|
-
|
66
|
-
* ruby 1.8 or 1.9
|
67
|
-
* libxml2
|
68
|
-
* libxml2-dev
|
69
|
-
* libxslt
|
70
|
-
* libxslt-dev
|
71
|
-
|
72
|
-
== INSTALL:
|
73
|
-
|
74
|
-
* sudo gem install nokogiri
|
75
|
-
|
76
|
-
== LICENSE:
|
77
|
-
|
78
|
-
(The MIT License)
|
79
|
-
|
80
|
-
Copyright (c) 2008 - 2010:
|
81
|
-
|
82
|
-
* {Aaron Patterson}[http://tenderlovemaking.com]
|
83
|
-
* {Mike Dalessio}[http://mike.daless.io]
|
84
|
-
* {Charles Nutter}[http://blog.headius.com]
|
85
|
-
* {Sergio Arbeo}[http://www.serabe.com]
|
86
|
-
* {Patrick Mahoney}[http://polycrystal.org]
|
87
|
-
* {Yoko Harada}[http://yokolet.blogspot.com]
|
88
|
-
|
89
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
90
|
-
a copy of this software and associated documentation files (the
|
91
|
-
'Software'), to deal in the Software without restriction, including
|
92
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
93
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
94
|
-
permit persons to whom the Software is furnished to do so, subject to
|
95
|
-
the following conditions:
|
96
|
-
|
97
|
-
The above copyright notice and this permission notice shall be
|
98
|
-
included in all copies or substantial portions of the Software.
|
99
|
-
|
100
|
-
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
101
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
102
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
103
|
-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
104
|
-
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
105
|
-
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
106
|
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
DELETED
@@ -1,175 +0,0 @@
|
|
1
|
-
= Nokogiri {<img src="https://secure.travis-ci.org/sparklemotion/nokogiri.png?rvm=1.9.3" />}[http://travis-ci.org/sparklemotion/nokogiri] {<img src="https://codeclimate.com/badge.png" />}[https://codeclimate.com/github/sparklemotion/nokogiri]
|
2
|
-
|
3
|
-
* http://nokogiri.org
|
4
|
-
* http://github.com/sparklemotion/nokogiri/wikis
|
5
|
-
* http://github.com/sparklemotion/nokogiri/tree/master
|
6
|
-
* http://groups.google.com/group/nokogiri-talk
|
7
|
-
* http://github.com/sparklemotion/nokogiri/issues
|
8
|
-
|
9
|
-
== DESCRIPTION:
|
10
|
-
|
11
|
-
Nokogiri (鋸) is an HTML, XML, SAX, and Reader parser. Among Nokogiri's
|
12
|
-
many features is the ability to search documents via XPath or CSS3 selectors.
|
13
|
-
|
14
|
-
XML is like violence - if it doesn’t solve your problems, you are not using
|
15
|
-
enough of it.
|
16
|
-
|
17
|
-
== FEATURES:
|
18
|
-
|
19
|
-
* XPath support for document searching
|
20
|
-
* CSS3 selector support for document searching
|
21
|
-
* XML/HTML builder
|
22
|
-
|
23
|
-
Nokogiri parses and searches XML/HTML very quickly, and also has
|
24
|
-
correctly implemented CSS3 selector support as well as XPath support.
|
25
|
-
|
26
|
-
== SUPPORT:
|
27
|
-
|
28
|
-
Before filing a bug report, please read our {submission guidelines}[http://nokogiri.org/tutorials/getting_help.html] at:
|
29
|
-
|
30
|
-
* http://nokogiri.org/tutorials/getting_help.html
|
31
|
-
|
32
|
-
The Nokogiri {mailing list}[http://groups.google.com/group/nokogiri-talk]
|
33
|
-
is available here:
|
34
|
-
|
35
|
-
* http://groups.google.com/group/nokogiri-talk
|
36
|
-
|
37
|
-
The {bug tracker}[http://github.com/sparklemotion/nokogiri/issues]
|
38
|
-
is available here:
|
39
|
-
|
40
|
-
* http://github.com/sparklemotion/nokogiri/issues
|
41
|
-
|
42
|
-
The IRC channel is #nokogiri on freenode.
|
43
|
-
|
44
|
-
== SYNOPSIS:
|
45
|
-
|
46
|
-
require 'nokogiri'
|
47
|
-
require 'open-uri'
|
48
|
-
|
49
|
-
# Get a Nokogiri::HTML::Document for the page we’re interested in...
|
50
|
-
|
51
|
-
doc = Nokogiri::HTML(open('http://www.google.com/search?q=sparklemotion'))
|
52
|
-
|
53
|
-
# Do funky things with it using Nokogiri::XML::Node methods...
|
54
|
-
|
55
|
-
####
|
56
|
-
# Search for nodes by css
|
57
|
-
doc.css('h3.r a').each do |link|
|
58
|
-
puts link.content
|
59
|
-
end
|
60
|
-
|
61
|
-
####
|
62
|
-
# Search for nodes by xpath
|
63
|
-
doc.xpath('//h3/a').each do |link|
|
64
|
-
puts link.content
|
65
|
-
end
|
66
|
-
|
67
|
-
####
|
68
|
-
# Or mix and match.
|
69
|
-
doc.search('h3.r a.l', '//h3/a').each do |link|
|
70
|
-
puts link.content
|
71
|
-
end
|
72
|
-
|
73
|
-
|
74
|
-
== REQUIREMENTS:
|
75
|
-
|
76
|
-
* ruby 1.8 or 1.9
|
77
|
-
* libxml2
|
78
|
-
* libxml2-dev
|
79
|
-
* libxslt
|
80
|
-
* libxslt-dev
|
81
|
-
|
82
|
-
== ENCODING:
|
83
|
-
|
84
|
-
Strings are always stored as UTF-8 internally. Methods that return
|
85
|
-
text values will always return UTF-8 encoded strings. Methods that
|
86
|
-
return XML (like to_xml, to_html and inner_html) will return a string
|
87
|
-
encoded like the source document.
|
88
|
-
|
89
|
-
*WARNING*
|
90
|
-
|
91
|
-
Some documents declare one particular encoding, but use a different
|
92
|
-
one. So, which encoding should the parser choose?
|
93
|
-
|
94
|
-
Remember that data is just a stream of bytes. Only we humans add
|
95
|
-
meaning to that stream. Any particular set of bytes could be valid
|
96
|
-
characters in multiple encodings, so detecting encoding with 100%
|
97
|
-
accuracy is not possible. libxml2 does its best, but it can't be right
|
98
|
-
100% of the time.
|
99
|
-
|
100
|
-
If you want Nokogiri to handle the document encoding properly, your
|
101
|
-
best bet is to explicitly set the encoding. Here is an example of
|
102
|
-
explicitly setting the encoding to EUC-JP on the parser:
|
103
|
-
|
104
|
-
doc = Nokogiri.XML('<foo><bar /><foo>', nil, 'EUC-JP')
|
105
|
-
|
106
|
-
== INSTALL:
|
107
|
-
|
108
|
-
* sudo gem install nokogiri
|
109
|
-
|
110
|
-
=== Binary packages
|
111
|
-
|
112
|
-
Binary packages are available for:
|
113
|
-
|
114
|
-
* SuSE[http://download.opensuse.org/repositories/devel:/languages:/ruby:/extensions/]
|
115
|
-
* Fedora[http://s390.koji.fedoraproject.org/koji/packageinfo?packageID=6756]
|
116
|
-
|
117
|
-
== DEVELOPMENT:
|
118
|
-
|
119
|
-
=== Developing on C Ruby (MRI)
|
120
|
-
|
121
|
-
Developing Nokogiri requires racc and rexical to generate the parser and
|
122
|
-
tokenizer. To start development, make sure you have `libxml2` and `libxslt`
|
123
|
-
installed.
|
124
|
-
|
125
|
-
Then install core gems and bootstrap:
|
126
|
-
|
127
|
-
$ gem install hoe rake-compiler mini_portile
|
128
|
-
$ rake newb
|
129
|
-
|
130
|
-
=== Developing on JRuby
|
131
|
-
|
132
|
-
Currently, development with JRuby depends on CRuby being installed. With
|
133
|
-
CRuby, install racc and rexical:
|
134
|
-
|
135
|
-
$ gem install racc rexical
|
136
|
-
|
137
|
-
Make sure hoe and rake compiler are installed with JRuby:
|
138
|
-
|
139
|
-
$ jgem install hoe rake-compiler
|
140
|
-
|
141
|
-
Then run rake:
|
142
|
-
|
143
|
-
$ jruby -S rake
|
144
|
-
|
145
|
-
== LICENSE:
|
146
|
-
|
147
|
-
(The MIT License)
|
148
|
-
|
149
|
-
Copyright (c) 2008 - 2012:
|
150
|
-
|
151
|
-
* {Aaron Patterson}[http://tenderlovemaking.com]
|
152
|
-
* {Mike Dalessio}[http://mike.daless.io]
|
153
|
-
* {Charles Nutter}[http://blog.headius.com]
|
154
|
-
* {Sergio Arbeo}[http://www.serabe.com]
|
155
|
-
* {Patrick Mahoney}[http://polycrystal.org]
|
156
|
-
* {Yoko Harada}[http://yokolet.blogspot.com]
|
157
|
-
|
158
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
159
|
-
a copy of this software and associated documentation files (the
|
160
|
-
'Software'), to deal in the Software without restriction, including
|
161
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
162
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
163
|
-
permit persons to whom the Software is furnished to do so, subject to
|
164
|
-
the following conditions:
|
165
|
-
|
166
|
-
The above copyright notice and this permission notice shall be
|
167
|
-
included in all copies or substantial portions of the Software.
|
168
|
-
|
169
|
-
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
170
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
171
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
172
|
-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
173
|
-
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
174
|
-
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
175
|
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|