vtd_xml 0.0.3-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +23 -0
- data/LICENSE.txt +20 -0
- data/README.md +29 -0
- data/Rakefile +20 -0
- data/bundle/bundler/setup.rb +10 -0
- data/bundle/jruby/1.9/bin/convert_to_should_syntax +23 -0
- data/bundle/jruby/1.9/bin/nokogiri +23 -0
- data/bundle/jruby/1.9/bin/rake +23 -0
- data/bundle/jruby/1.9/build_info/mini_portile-0.5.2.info +1 -0
- data/bundle/jruby/1.9/build_info/nokogiri-1.6.1-java.info +1 -0
- data/bundle/jruby/1.9/build_info/rake-10.1.1.info +1 -0
- data/bundle/jruby/1.9/build_info/shoulda-context-1.1.6.info +1 -0
- data/bundle/jruby/1.9/cache/mini_portile-0.5.2.gem +0 -0
- data/bundle/jruby/1.9/cache/nokogiri-1.6.1-java.gem +0 -0
- data/bundle/jruby/1.9/cache/rake-10.1.1.gem +0 -0
- data/bundle/jruby/1.9/cache/shoulda-context-1.1.6.gem +0 -0
- data/bundle/jruby/1.9/gems/mini_portile-0.5.2/History.txt +65 -0
- data/bundle/jruby/1.9/gems/mini_portile-0.5.2/LICENSE.txt +20 -0
- data/bundle/jruby/1.9/gems/mini_portile-0.5.2/README.rdoc +169 -0
- data/bundle/jruby/1.9/gems/mini_portile-0.5.2/Rakefile +44 -0
- data/bundle/jruby/1.9/gems/mini_portile-0.5.2/examples/Rakefile +55 -0
- data/bundle/jruby/1.9/gems/mini_portile-0.5.2/lib/mini_portile.rb +404 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/CHANGELOG.ja.rdoc +828 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/CHANGELOG.rdoc +835 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/C_CODING_STYLE.rdoc +33 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/Gemfile +21 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/Manifest.txt +315 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/README.ja.rdoc +106 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/README.rdoc +175 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ROADMAP.md +90 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/Rakefile +248 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/STANDARD_RESPONSES.md +47 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/Y_U_NO_GEMSPEC.md +155 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/bin/nokogiri +78 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/build_all +105 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/dependencies.yml +4 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/EncodingHandler.java +124 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/HtmlDocument.java +189 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/HtmlElementDescription.java +145 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/HtmlEntityLookup.java +79 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/HtmlSaxParserContext.java +259 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/NokogiriService.java +605 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/XmlAttr.java +190 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/XmlAttributeDecl.java +130 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/XmlCdata.java +84 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/XmlComment.java +95 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/XmlDocument.java +598 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/XmlDocumentFragment.java +210 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/XmlDtd.java +480 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/XmlElement.java +88 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/XmlElementContent.java +382 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/XmlElementDecl.java +152 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/XmlEntityDecl.java +162 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/XmlEntityReference.java +101 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/XmlNamespace.java +216 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/XmlNode.java +1637 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/XmlNodeSet.java +270 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/XmlProcessingInstruction.java +99 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/XmlReader.java +532 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/XmlRelaxng.java +144 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/XmlSaxParserContext.java +356 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/XmlSaxPushParser.java +232 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/XmlSchema.java +324 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/XmlSyntaxError.java +136 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/XmlText.java +107 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/XmlXpathContext.java +203 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/XsltStylesheet.java +360 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/internals/ClosedStreamException.java +10 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/internals/HtmlDomParserContext.java +243 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/internals/NokogiriBlockingQueueInputStream.java +151 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/internals/NokogiriDocumentCache.java +73 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/internals/NokogiriDomParser.java +116 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/internals/NokogiriEncodingReaderWrapper.java +109 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/internals/NokogiriEntityResolver.java +123 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/internals/NokogiriErrorHandler.java +86 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/internals/NokogiriHandler.java +341 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/internals/NokogiriHelpers.java +826 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/internals/NokogiriNamespaceCache.java +180 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/internals/NokogiriNamespaceContext.java +130 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/internals/NokogiriNonStrictErrorHandler.java +98 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/internals/NokogiriNonStrictErrorHandler4NekoHtml.java +121 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/internals/NokogiriStrictErrorHandler.java +79 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/internals/NokogiriXPathFunction.java +141 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/internals/NokogiriXPathFunctionResolver.java +73 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/internals/NokogiriXPathVariableResolver.java +67 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/internals/NokogiriXsltErrorListener.java +87 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/internals/ParserContext.java +289 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/internals/ReaderNode.java +534 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/internals/SaveContextVisitor.java +780 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/internals/SchemaErrorHandler.java +76 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/internals/UncloseableInputStream.java +102 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/internals/XmlDeclHandler.java +42 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/internals/XmlDomParserContext.java +275 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/internals/XmlSaxParser.java +65 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/java/nokogiri/internals/XsltExtensionFunction.java +72 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/depend +358 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/extconf.rb +195 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/html_document.c +170 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/html_document.h +10 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/html_element_description.c +279 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/html_element_description.h +10 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/html_entity_lookup.c +32 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/html_entity_lookup.h +8 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/html_sax_parser_context.c +116 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/html_sax_parser_context.h +11 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/html_sax_push_parser.c +87 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/html_sax_push_parser.h +9 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/nokogiri.c +143 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/nokogiri.h +164 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_attr.c +94 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_attr.h +9 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_attribute_decl.c +70 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_attribute_decl.h +9 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_cdata.c +56 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_cdata.h +9 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_comment.c +54 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_comment.h +9 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_document.c +576 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_document.h +23 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_document_fragment.c +48 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_document_fragment.h +10 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_dtd.c +202 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_dtd.h +10 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_element_content.c +123 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_element_content.h +10 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_element_decl.c +69 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_element_decl.h +9 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_encoding_handler.c +79 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_encoding_handler.h +8 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_entity_decl.c +110 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_entity_decl.h +10 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_entity_reference.c +52 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_entity_reference.h +9 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_io.c +56 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_io.h +11 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_libxml2_hacks.c +112 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_libxml2_hacks.h +12 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_namespace.c +78 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_namespace.h +13 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_node.c +1534 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_node.h +13 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_node_set.c +467 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_node_set.h +14 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_processing_instruction.c +56 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_processing_instruction.h +9 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_reader.c +681 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_reader.h +10 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_relax_ng.c +161 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_relax_ng.h +9 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_sax_parser.c +312 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_sax_parser.h +39 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_sax_parser_context.c +222 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_sax_parser_context.h +10 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_sax_push_parser.c +115 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_sax_push_parser.h +9 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_schema.c +205 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_schema.h +9 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_syntax_error.c +58 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_syntax_error.h +13 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_text.c +52 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_text.h +9 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_xpath_context.c +319 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xml_xpath_context.h +10 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xslt_stylesheet.c +270 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/ext/nokogiri/xslt_stylesheet.h +14 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/isorelax.jar +0 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/jing.jar +0 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nekodtd.jar +0 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nekohtml.jar +0 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/css/node.rb +102 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/css/parser.rb +720 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/css/parser.y +258 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/css/parser_extras.rb +91 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/css/syntax_error.rb +7 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/css/tokenizer.rb +152 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/css/tokenizer.rex +55 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/css/xpath_visitor.rb +171 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/css.rb +27 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/decorators/slop.rb +35 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/html/builder.rb +35 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/html/document.rb +254 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/html/document_fragment.rb +41 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/html/element_description.rb +23 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/html/element_description_defaults.rb +671 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/html/entity_lookup.rb +13 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/html/sax/parser.rb +52 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/html/sax/parser_context.rb +16 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/html/sax/push_parser.rb +16 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/html.rb +37 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/nokogiri.jar +0 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/syntax_error.rb +4 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/version.rb +106 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/xml/attr.rb +14 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/xml/attribute_decl.rb +18 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/xml/builder.rb +443 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/xml/cdata.rb +11 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/xml/character_data.rb +7 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/xml/document.rb +279 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/xml/document_fragment.rb +112 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/xml/dtd.rb +22 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/xml/element_content.rb +36 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/xml/element_decl.rb +13 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/xml/entity_decl.rb +19 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/xml/namespace.rb +13 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/xml/node/save_options.rb +61 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/xml/node.rb +957 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/xml/node_set.rb +355 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/xml/notation.rb +6 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/xml/parse_options.rb +98 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/xml/pp/character_data.rb +18 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/xml/pp/node.rb +56 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/xml/pp.rb +2 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/xml/processing_instruction.rb +8 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/xml/reader.rb +112 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/xml/relax_ng.rb +32 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/xml/sax/document.rb +171 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/xml/sax/parser.rb +123 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/xml/sax/parser_context.rb +16 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/xml/sax/push_parser.rb +60 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/xml/sax.rb +4 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/xml/schema.rb +63 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/xml/syntax_error.rb +47 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/xml/text.rb +9 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/xml/xpath/syntax_error.rb +11 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/xml/xpath.rb +10 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/xml/xpath_context.rb +16 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/xml.rb +73 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/xslt/stylesheet.rb +25 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri/xslt.rb +56 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/nokogiri.rb +128 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/xercesImpl.jar +0 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/lib/xsd/xmlparser/nokogiri.rb +102 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/tasks/cross_compile.rb +134 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/tasks/nokogiri.org.rb +24 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/tasks/test.rb +95 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/css/test_nthiness.rb +159 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/css/test_parser.rb +341 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/css/test_tokenizer.rb +198 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/css/test_xpath_visitor.rb +91 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/decorators/test_slop.rb +16 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/files/2ch.html +108 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/files/address_book.rlx +12 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/files/address_book.xml +10 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/files/bar/bar.xsd +4 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/files/bogus.xml +0 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/files/dont_hurt_em_why.xml +422 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/files/encoding.html +82 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/files/encoding.xhtml +84 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/files/exslt.xml +8 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/files/exslt.xslt +35 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/files/foo/foo.xsd +4 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/files/metacharset.html +10 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/files/noencoding.html +47 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/files/po.xml +32 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/files/po.xsd +66 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/files/saml/saml20assertion_schema.xsd +283 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/files/saml/saml20protocol_schema.xsd +302 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/files/saml/xenc_schema.xsd +146 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/files/saml/xmldsig_schema.xsd +318 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/files/shift_jis.html +10 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/files/shift_jis.xml +5 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/files/snuggles.xml +3 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/files/staff.dtd +10 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/files/staff.xml +59 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/files/staff.xslt +32 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/files/test_document_url/bar.xml +2 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/files/test_document_url/document.dtd +4 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/files/test_document_url/document.xml +6 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/files/tlm.html +850 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/files/to_be_xincluded.xml +2 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/files/valid_bar.xml +2 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/files/xinclude.xml +4 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/helper.rb +154 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/html/sax/test_parser.rb +141 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/html/sax/test_parser_context.rb +46 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/html/test_builder.rb +164 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/html/test_document.rb +552 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/html/test_document_encoding.rb +138 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/html/test_document_fragment.rb +261 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/html/test_element_description.rb +105 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/html/test_named_characters.rb +14 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/html/test_node.rb +196 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/html/test_node_encoding.rb +27 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/namespaces/test_additional_namespaces_in_builder_doc.rb +14 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/namespaces/test_namespaces_in_builder_doc.rb +75 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/namespaces/test_namespaces_in_created_doc.rb +75 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/namespaces/test_namespaces_in_parsed_doc.rb +66 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/test_convert_xpath.rb +135 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/test_css_cache.rb +45 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/test_encoding_handler.rb +46 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/test_memory_leak.rb +156 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/test_nokogiri.rb +132 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/test_reader.rb +555 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/test_soap4r_sax.rb +52 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/test_xslt_transforms.rb +254 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/xml/node/test_save_options.rb +28 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/xml/node/test_subclass.rb +44 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/xml/sax/test_parser.rb +366 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/xml/sax/test_parser_context.rb +106 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/xml/sax/test_push_parser.rb +157 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/xml/test_attr.rb +64 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/xml/test_attribute_decl.rb +86 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/xml/test_builder.rb +306 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/xml/test_c14n.rb +151 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/xml/test_cdata.rb +48 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/xml/test_comment.rb +29 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/xml/test_document.rb +868 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/xml/test_document_encoding.rb +28 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/xml/test_document_fragment.rb +223 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/xml/test_dtd.rb +103 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/xml/test_dtd_encoding.rb +33 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/xml/test_element_content.rb +56 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/xml/test_element_decl.rb +73 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/xml/test_entity_decl.rb +122 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/xml/test_entity_reference.rb +245 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/xml/test_namespace.rb +95 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/xml/test_node.rb +1137 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/xml/test_node_attributes.rb +96 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/xml/test_node_encoding.rb +107 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/xml/test_node_inheritance.rb +32 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/xml/test_node_reparenting.rb +374 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/xml/test_node_set.rb +755 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/xml/test_parse_options.rb +64 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/xml/test_processing_instruction.rb +30 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/xml/test_reader_encoding.rb +142 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/xml/test_relax_ng.rb +60 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/xml/test_schema.rb +103 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/xml/test_syntax_error.rb +12 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/xml/test_text.rb +45 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/xml/test_unparented_node.rb +422 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/xml/test_xinclude.rb +83 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/xml/test_xpath.rb +295 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/xslt/test_custom_functions.rb +133 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test/xslt/test_exception_handling.rb +37 -0
- data/bundle/jruby/1.9/gems/nokogiri-1.6.1-java/test_all +81 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/CHANGES +530 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/MIT-LICENSE +21 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/README.rdoc +187 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/Rakefile +374 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/TODO +21 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/bin/rake +33 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/doc/command_line_usage.rdoc +152 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/doc/example/Rakefile1 +38 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/doc/example/Rakefile2 +35 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/doc/example/a.c +6 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/doc/example/b.c +6 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/doc/example/main.c +11 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/doc/glossary.rdoc +51 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/doc/jamis.rb +591 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/doc/proto_rake.rdoc +127 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/doc/rake.1.gz +0 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/doc/rakefile.rdoc +617 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/doc/rational.rdoc +151 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/doc/release_notes/rake-0.4.14.rdoc +23 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/doc/release_notes/rake-0.4.15.rdoc +35 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/doc/release_notes/rake-0.5.0.rdoc +53 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/doc/release_notes/rake-0.5.3.rdoc +78 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/doc/release_notes/rake-0.5.4.rdoc +46 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/doc/release_notes/rake-0.6.0.rdoc +141 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/doc/release_notes/rake-0.7.0.rdoc +119 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/doc/release_notes/rake-0.7.1.rdoc +59 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/doc/release_notes/rake-0.7.2.rdoc +121 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/doc/release_notes/rake-0.7.3.rdoc +47 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/doc/release_notes/rake-0.8.0.rdoc +114 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/doc/release_notes/rake-0.8.2.rdoc +165 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/doc/release_notes/rake-0.8.3.rdoc +112 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/doc/release_notes/rake-0.8.4.rdoc +147 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/doc/release_notes/rake-0.8.5.rdoc +53 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/doc/release_notes/rake-0.8.6.rdoc +55 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/doc/release_notes/rake-0.8.7.rdoc +55 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/doc/release_notes/rake-0.9.0.rdoc +112 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/doc/release_notes/rake-0.9.1.rdoc +52 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/doc/release_notes/rake-0.9.2.2.rdoc +55 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/doc/release_notes/rake-0.9.2.rdoc +49 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/doc/release_notes/rake-0.9.3.rdoc +102 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/doc/release_notes/rake-0.9.4.rdoc +110 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/doc/release_notes/rake-0.9.5.rdoc +114 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/doc/release_notes/rake-0.9.6.rdoc +127 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/doc/release_notes/rake-10.0.0.rdoc +178 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/doc/release_notes/rake-10.0.1.rdoc +187 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/doc/release_notes/rake-10.0.2.rdoc +191 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/doc/release_notes/rake-10.0.3.rdoc +191 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/doc/release_notes/rake-10.1.0.rdoc +61 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/install.rb +80 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/alt_system.rb +108 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/application.rb +728 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/backtrace.rb +20 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/clean.rb +55 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/cloneable.rb +16 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/contrib/compositepublisher.rb +21 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/contrib/ftptools.rb +139 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/contrib/publisher.rb +73 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/contrib/rubyforgepublisher.rb +16 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/contrib/sshpublisher.rb +50 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/contrib/sys.rb +2 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/default_loader.rb +10 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/dsl_definition.rb +157 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/early_time.rb +18 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/ext/core.rb +28 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/ext/module.rb +0 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/ext/string.rb +166 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/ext/time.rb +15 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/file_creation_task.rb +24 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/file_list.rb +416 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/file_task.rb +46 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/file_utils.rb +116 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/file_utils_ext.rb +144 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/gempackagetask.rb +2 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/invocation_chain.rb +57 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/invocation_exception_mixin.rb +16 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/linked_list.rb +103 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/loaders/makefile.rb +40 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/multi_task.rb +13 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/name_space.rb +25 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/packagetask.rb +190 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/pathmap.rb +1 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/phony.rb +15 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/private_reader.rb +20 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/promise.rb +99 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/pseudo_status.rb +29 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/rake_module.rb +37 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/rake_test_loader.rb +22 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/rdoctask.rb +2 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/ruby182_test_unit_fix.rb +27 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/rule_recursion_overflow_error.rb +20 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/runtest.rb +22 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/scope.rb +42 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/task.rb +378 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/task_argument_error.rb +7 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/task_arguments.rb +89 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/task_manager.rb +297 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/tasklib.rb +22 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/testtask.rb +201 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/thread_history_display.rb +48 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/thread_pool.rb +161 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/trace_output.rb +22 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/version.rb +9 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake/win32.rb +56 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/lib/rake.rb +73 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/test/file_creation.rb +34 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/test/helper.rb +128 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/test/support/rakefile_definitions.rb +444 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/test/support/ruby_runner.rb +33 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/test/test_private_reader.rb +42 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/test/test_rake.rb +40 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/test/test_rake_application.rb +517 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/test/test_rake_application_options.rb +457 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/test/test_rake_backtrace.rb +113 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/test/test_rake_clean.rb +46 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/test/test_rake_definitions.rb +79 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/test/test_rake_directory_task.rb +57 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/test/test_rake_dsl.rb +40 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/test/test_rake_early_time.rb +31 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/test/test_rake_extension.rb +59 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/test/test_rake_file_creation_task.rb +56 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/test/test_rake_file_list.rb +627 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/test/test_rake_file_list_path_map.rb +8 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/test/test_rake_file_task.rb +122 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/test/test_rake_file_utils.rb +309 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/test/test_rake_ftp_file.rb +74 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/test/test_rake_functional.rb +466 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/test/test_rake_invocation_chain.rb +64 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/test/test_rake_linked_list.rb +84 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/test/test_rake_makefile_loader.rb +46 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/test/test_rake_multi_task.rb +58 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/test/test_rake_name_space.rb +43 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/test/test_rake_package_task.rb +79 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/test/test_rake_path_map.rb +168 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/test/test_rake_path_map_explode.rb +34 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/test/test_rake_path_map_partial.rb +18 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/test/test_rake_pseudo_status.rb +21 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/test/test_rake_rake_test_loader.rb +20 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/test/test_rake_reduce_compat.rb +26 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/test/test_rake_require.rb +40 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/test/test_rake_rules.rb +362 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/test/test_rake_scope.rb +44 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/test/test_rake_task.rb +376 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/test/test_rake_task_argument_parsing.rb +103 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/test/test_rake_task_arguments.rb +121 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/test/test_rake_task_lib.rb +9 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/test/test_rake_task_manager.rb +158 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/test/test_rake_task_manager_argument_resolution.rb +19 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/test/test_rake_task_with_arguments.rb +171 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/test/test_rake_test_task.rb +119 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/test/test_rake_thread_pool.rb +142 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/test/test_rake_top_level_functions.rb +71 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/test/test_rake_win32.rb +72 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/test/test_thread_history_display.rb +101 -0
- data/bundle/jruby/1.9/gems/rake-10.1.1/test/test_trace_output.rb +52 -0
- data/bundle/jruby/1.9/gems/shoulda-context-1.1.6/Appraisals +21 -0
- data/bundle/jruby/1.9/gems/shoulda-context-1.1.6/CONTRIBUTING.md +38 -0
- data/bundle/jruby/1.9/gems/shoulda-context-1.1.6/Gemfile +3 -0
- data/bundle/jruby/1.9/gems/shoulda-context-1.1.6/MIT-LICENSE +22 -0
- data/bundle/jruby/1.9/gems/shoulda-context-1.1.6/README.md +54 -0
- data/bundle/jruby/1.9/gems/shoulda-context-1.1.6/Rakefile +21 -0
- data/bundle/jruby/1.9/gems/shoulda-context-1.1.6/bin/convert_to_should_syntax +42 -0
- data/bundle/jruby/1.9/gems/shoulda-context-1.1.6/gemfiles/3.0.gemfile +7 -0
- data/bundle/jruby/1.9/gems/shoulda-context-1.1.6/gemfiles/3.0.gemfile.lock +91 -0
- data/bundle/jruby/1.9/gems/shoulda-context-1.1.6/gemfiles/3.1.gemfile +9 -0
- data/bundle/jruby/1.9/gems/shoulda-context-1.1.6/gemfiles/3.1.gemfile.lock +112 -0
- data/bundle/jruby/1.9/gems/shoulda-context-1.1.6/gemfiles/3.2.gemfile +9 -0
- data/bundle/jruby/1.9/gems/shoulda-context-1.1.6/gemfiles/3.2.gemfile.lock +111 -0
- data/bundle/jruby/1.9/gems/shoulda-context-1.1.6/gemfiles/4.0.gemfile +9 -0
- data/bundle/jruby/1.9/gems/shoulda-context-1.1.6/gemfiles/4.0.gemfile.lock +107 -0
- data/bundle/jruby/1.9/gems/shoulda-context-1.1.6/init.rb +1 -0
- data/bundle/jruby/1.9/gems/shoulda-context-1.1.6/lib/shoulda/context/assertions.rb +96 -0
- data/bundle/jruby/1.9/gems/shoulda-context-1.1.6/lib/shoulda/context/autoload_macros.rb +46 -0
- data/bundle/jruby/1.9/gems/shoulda-context-1.1.6/lib/shoulda/context/context.rb +481 -0
- data/bundle/jruby/1.9/gems/shoulda-context-1.1.6/lib/shoulda/context/proc_extensions.rb +14 -0
- data/bundle/jruby/1.9/gems/shoulda-context-1.1.6/lib/shoulda/context/tasks/list_tests.rake +29 -0
- data/bundle/jruby/1.9/gems/shoulda-context-1.1.6/lib/shoulda/context/tasks/yaml_to_shoulda.rake +28 -0
- data/bundle/jruby/1.9/gems/shoulda-context-1.1.6/lib/shoulda/context/tasks.rb +3 -0
- data/bundle/jruby/1.9/gems/shoulda-context-1.1.6/lib/shoulda/context/version.rb +5 -0
- data/bundle/jruby/1.9/gems/shoulda-context-1.1.6/lib/shoulda/context.rb +33 -0
- data/bundle/jruby/1.9/gems/shoulda-context-1.1.6/lib/shoulda-context.rb +1 -0
- data/bundle/jruby/1.9/gems/shoulda-context-1.1.6/rails/init.rb +4 -0
- data/bundle/jruby/1.9/gems/shoulda-context-1.1.6/shoulda-context.gemspec +27 -0
- data/bundle/jruby/1.9/gems/shoulda-context-1.1.6/tasks/shoulda.rake +1 -0
- data/bundle/jruby/1.9/gems/shoulda-context-1.1.6/test/fake_rails_root/test/shoulda_macros/custom_macro.rb +6 -0
- data/bundle/jruby/1.9/gems/shoulda-context-1.1.6/test/shoulda/autoload_macro_test.rb +18 -0
- data/bundle/jruby/1.9/gems/shoulda-context-1.1.6/test/shoulda/context_test.rb +360 -0
- data/bundle/jruby/1.9/gems/shoulda-context-1.1.6/test/shoulda/convert_to_should_syntax_test.rb +63 -0
- data/bundle/jruby/1.9/gems/shoulda-context-1.1.6/test/shoulda/helpers_test.rb +190 -0
- data/bundle/jruby/1.9/gems/shoulda-context-1.1.6/test/shoulda/should_test.rb +291 -0
- data/bundle/jruby/1.9/gems/shoulda-context-1.1.6/test/test_helper.rb +11 -0
- data/bundle/jruby/1.9/specifications/mini_portile-0.5.2.gemspec +22 -0
- data/bundle/jruby/1.9/specifications/nokogiri-1.6.1-java.gemspec +69 -0
- data/bundle/jruby/1.9/specifications/rake-10.1.1.gemspec +35 -0
- data/bundle/jruby/1.9/specifications/shoulda-context-1.1.6.gemspec +44 -0
- data/lib/vtd-xml-2.11.jar +0 -0
- data/lib/vtd_xml/document.rb +124 -0
- data/lib/vtd_xml/extraction_error.rb +4 -0
- data/lib/vtd_xml/modify_error.rb +5 -0
- data/lib/vtd_xml/parse_error.rb +5 -0
- data/lib/vtd_xml/version.rb +4 -0
- data/lib/vtd_xml/xpath_error.rb +4 -0
- data/lib/vtd_xml.rb +8 -0
- data/pkg/vtd_xml-0.0.3-java.gem +0 -0
- data/test/test_load_paths.rb +18 -0
- data/test/unit/vtd_xml/document_test.rb +266 -0
- data/vtd_xml.gemspec +25 -0
- data/vtd_xml.iml +16 -0
- metadata +648 -0
@@ -0,0 +1,868 @@
|
|
1
|
+
require "helper"
|
2
|
+
|
3
|
+
require 'uri'
|
4
|
+
|
5
|
+
module Nokogiri
|
6
|
+
module XML
|
7
|
+
class TestDocument < Nokogiri::TestCase
|
8
|
+
URI = if URI.const_defined?(:DEFAULT_PARSER)
|
9
|
+
::URI::DEFAULT_PARSER
|
10
|
+
else
|
11
|
+
::URI
|
12
|
+
end
|
13
|
+
|
14
|
+
def setup
|
15
|
+
super
|
16
|
+
@xml = Nokogiri::XML.parse(File.read(XML_FILE), XML_FILE)
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_dtd_with_empty_internal_subset
|
20
|
+
doc = Nokogiri::XML <<-eoxml
|
21
|
+
<?xml version="1.0"?>
|
22
|
+
<!DOCTYPE people >
|
23
|
+
<people>
|
24
|
+
</people>
|
25
|
+
eoxml
|
26
|
+
assert doc.root
|
27
|
+
end
|
28
|
+
|
29
|
+
# issue #838
|
30
|
+
def test_document_with_invalid_prolog
|
31
|
+
doc = Nokogiri::XML '<? ?>'
|
32
|
+
assert_empty doc.content
|
33
|
+
end
|
34
|
+
|
35
|
+
# issue #837
|
36
|
+
def test_document_with_refentity
|
37
|
+
doc = Nokogiri::XML '&'
|
38
|
+
assert_equal '', doc.content
|
39
|
+
end
|
40
|
+
|
41
|
+
# issue #835
|
42
|
+
def test_manually_adding_reference_entities
|
43
|
+
d = Nokogiri::XML::Document.new
|
44
|
+
root = Nokogiri::XML::Element.new('bar', d)
|
45
|
+
txt = Nokogiri::XML::Text.new('foo', d)
|
46
|
+
ent = Nokogiri::XML::EntityReference.new(d, '#8217')
|
47
|
+
root << txt
|
48
|
+
root << ent
|
49
|
+
d << root
|
50
|
+
assert_match /’/, d.to_html
|
51
|
+
end
|
52
|
+
|
53
|
+
def test_document_with_initial_space
|
54
|
+
doc = Nokogiri::XML(" <?xml version='1.0' encoding='utf-8' ?><first \>")
|
55
|
+
assert_equal 2, doc.children.size
|
56
|
+
end
|
57
|
+
|
58
|
+
def test_root_set_to_nil
|
59
|
+
@xml.root = nil
|
60
|
+
assert_equal nil, @xml.root
|
61
|
+
end
|
62
|
+
|
63
|
+
def test_million_laugh_attach
|
64
|
+
doc = Nokogiri::XML '<?xml version="1.0"?>
|
65
|
+
<!DOCTYPE lolz [
|
66
|
+
<!ENTITY lol "lol">
|
67
|
+
<!ENTITY lol2 "&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;">
|
68
|
+
<!ENTITY lol3 "&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;">
|
69
|
+
<!ENTITY lol4 "&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;">
|
70
|
+
<!ENTITY lol5 "&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;">
|
71
|
+
<!ENTITY lol6 "&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;&lol5;">
|
72
|
+
<!ENTITY lol7 "&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;&lol6;">
|
73
|
+
<!ENTITY lol8 "&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;&lol7;">
|
74
|
+
<!ENTITY lol9 "&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;&lol8;">
|
75
|
+
]>
|
76
|
+
<lolz>&lol9;</lolz>'
|
77
|
+
assert_not_nil doc
|
78
|
+
end
|
79
|
+
|
80
|
+
def test_million_laugh_attach_2
|
81
|
+
doc = Nokogiri::XML '<?xml version="1.0" encoding="UTF-8"?>
|
82
|
+
<!DOCTYPE member [
|
83
|
+
<!ENTITY a "&b;&b;&b;&b;&b;&b;&b;&b;&b;&b;">
|
84
|
+
<!ENTITY b "&c;&c;&c;&c;&c;&c;&c;&c;&c;&c;">
|
85
|
+
<!ENTITY c "&d;&d;&d;&d;&d;&d;&d;&d;&d;&d;">
|
86
|
+
<!ENTITY d "&e;&e;&e;&e;&e;&e;&e;&e;&e;&e;">
|
87
|
+
<!ENTITY e "&f;&f;&f;&f;&f;&f;&f;&f;&f;&f;">
|
88
|
+
<!ENTITY f "&g;&g;&g;&g;&g;&g;&g;&g;&g;&g;">
|
89
|
+
<!ENTITY g "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx">
|
90
|
+
]>
|
91
|
+
<member>
|
92
|
+
&a;
|
93
|
+
</member>'
|
94
|
+
assert_not_nil doc
|
95
|
+
end
|
96
|
+
|
97
|
+
def test_ignore_unknown_namespace
|
98
|
+
doc = Nokogiri::XML(<<-eoxml)
|
99
|
+
<xml>
|
100
|
+
<unknown:foo xmlns='http://hello.com/' />
|
101
|
+
<bar />
|
102
|
+
</xml>
|
103
|
+
eoxml
|
104
|
+
if Nokogiri.jruby?
|
105
|
+
refute doc.xpath('//foo').first.namespace # assert that the namespace is nil
|
106
|
+
end
|
107
|
+
refute_empty doc.xpath('//bar'), "bar wasn't found in the document" # bar should be part of the doc
|
108
|
+
end
|
109
|
+
|
110
|
+
def test_collect_namespaces
|
111
|
+
doc = Nokogiri::XML(<<-eoxml)
|
112
|
+
<xml>
|
113
|
+
<foo xmlns='hello'>
|
114
|
+
<bar xmlns:foo='world' />
|
115
|
+
</foo>
|
116
|
+
</xml>
|
117
|
+
eoxml
|
118
|
+
assert_equal({"xmlns"=>"hello", "xmlns:foo"=>"world"},
|
119
|
+
doc.collect_namespaces)
|
120
|
+
end
|
121
|
+
|
122
|
+
def test_subclass_initialize_modify # testing a segv
|
123
|
+
Class.new(Nokogiri::XML::Document) {
|
124
|
+
def initialize
|
125
|
+
super
|
126
|
+
body_node = Nokogiri::XML::Node.new "body", self
|
127
|
+
body_node.content = "stuff"
|
128
|
+
self.root = body_node
|
129
|
+
end
|
130
|
+
}.new
|
131
|
+
end
|
132
|
+
|
133
|
+
def test_create_text_node
|
134
|
+
txt = @xml.create_text_node 'foo'
|
135
|
+
assert_instance_of Nokogiri::XML::Text, txt
|
136
|
+
assert_equal 'foo', txt.text
|
137
|
+
assert_equal @xml, txt.document
|
138
|
+
end
|
139
|
+
|
140
|
+
def test_create_text_node_with_block
|
141
|
+
@xml.create_text_node 'foo' do |txt|
|
142
|
+
assert_instance_of Nokogiri::XML::Text, txt
|
143
|
+
assert_equal 'foo', txt.text
|
144
|
+
assert_equal @xml, txt.document
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
148
|
+
def test_create_element
|
149
|
+
elm = @xml.create_element('foo')
|
150
|
+
assert_instance_of Nokogiri::XML::Element, elm
|
151
|
+
assert_equal 'foo', elm.name
|
152
|
+
assert_equal @xml, elm.document
|
153
|
+
end
|
154
|
+
|
155
|
+
def test_create_element_with_block
|
156
|
+
@xml.create_element('foo') do |elm|
|
157
|
+
assert_instance_of Nokogiri::XML::Element, elm
|
158
|
+
assert_equal 'foo', elm.name
|
159
|
+
assert_equal @xml, elm.document
|
160
|
+
end
|
161
|
+
end
|
162
|
+
|
163
|
+
def test_create_element_with_attributes
|
164
|
+
elm = @xml.create_element('foo',:a => "1")
|
165
|
+
assert_instance_of Nokogiri::XML::Element, elm
|
166
|
+
assert_instance_of Nokogiri::XML::Attr, elm.attributes["a"]
|
167
|
+
assert_equal "1", elm["a"]
|
168
|
+
end
|
169
|
+
|
170
|
+
def test_create_element_with_namespace
|
171
|
+
elm = @xml.create_element('foo',:'xmlns:foo' => 'http://tenderlovemaking.com')
|
172
|
+
assert_equal 'http://tenderlovemaking.com', elm.namespaces['xmlns:foo']
|
173
|
+
end
|
174
|
+
|
175
|
+
def test_create_element_with_hyphenated_namespace
|
176
|
+
elm = @xml.create_element('foo',:'xmlns:SOAP-ENC' => 'http://tenderlovemaking.com')
|
177
|
+
assert_equal 'http://tenderlovemaking.com', elm.namespaces['xmlns:SOAP-ENC']
|
178
|
+
end
|
179
|
+
|
180
|
+
def test_create_element_with_content
|
181
|
+
elm = @xml.create_element('foo',"needs more xml/violence")
|
182
|
+
assert_equal "needs more xml/violence", elm.content
|
183
|
+
end
|
184
|
+
|
185
|
+
def test_create_cdata
|
186
|
+
cdata = @xml.create_cdata("abc")
|
187
|
+
assert_instance_of Nokogiri::XML::CDATA, cdata
|
188
|
+
assert_equal "abc", cdata.content
|
189
|
+
end
|
190
|
+
|
191
|
+
def test_create_cdata_with_block
|
192
|
+
@xml.create_cdata("abc") do |cdata|
|
193
|
+
assert_instance_of Nokogiri::XML::CDATA, cdata
|
194
|
+
assert_equal "abc", cdata.content
|
195
|
+
end
|
196
|
+
end
|
197
|
+
|
198
|
+
def test_create_comment
|
199
|
+
comment = @xml.create_comment("abc")
|
200
|
+
assert_instance_of Nokogiri::XML::Comment, comment
|
201
|
+
assert_equal "abc", comment.content
|
202
|
+
end
|
203
|
+
|
204
|
+
def test_create_comment_with_block
|
205
|
+
@xml.create_comment("abc") do |comment|
|
206
|
+
assert_instance_of Nokogiri::XML::Comment, comment
|
207
|
+
assert_equal "abc", comment.content
|
208
|
+
end
|
209
|
+
end
|
210
|
+
|
211
|
+
def test_pp
|
212
|
+
out = StringIO.new('')
|
213
|
+
::PP.pp @xml, out
|
214
|
+
assert_operator out.string.length, :>, 0
|
215
|
+
end
|
216
|
+
|
217
|
+
def test_create_internal_subset_on_existing_subset
|
218
|
+
assert_not_nil @xml.internal_subset
|
219
|
+
assert_raises(RuntimeError) do
|
220
|
+
@xml.create_internal_subset('staff', nil, 'staff.dtd')
|
221
|
+
end
|
222
|
+
end
|
223
|
+
|
224
|
+
def test_create_internal_subset
|
225
|
+
xml = Nokogiri::XML('<root />')
|
226
|
+
assert_nil xml.internal_subset
|
227
|
+
|
228
|
+
xml.create_internal_subset('name', nil, 'staff.dtd')
|
229
|
+
ss = xml.internal_subset
|
230
|
+
assert_equal 'name', ss.name
|
231
|
+
assert_nil ss.external_id
|
232
|
+
assert_equal 'staff.dtd', ss.system_id
|
233
|
+
end
|
234
|
+
|
235
|
+
def test_external_subset
|
236
|
+
assert_nil @xml.external_subset
|
237
|
+
Dir.chdir(ASSETS_DIR) do
|
238
|
+
@xml = Nokogiri::XML.parse(File.read(XML_FILE), XML_FILE) { |cfg|
|
239
|
+
cfg.dtdload
|
240
|
+
}
|
241
|
+
end
|
242
|
+
assert @xml.external_subset
|
243
|
+
end
|
244
|
+
|
245
|
+
def test_create_external_subset_fails_with_existing_subset
|
246
|
+
assert_nil @xml.external_subset
|
247
|
+
Dir.chdir(ASSETS_DIR) do
|
248
|
+
@xml = Nokogiri::XML.parse(File.read(XML_FILE), XML_FILE) { |cfg|
|
249
|
+
cfg.dtdload
|
250
|
+
}
|
251
|
+
end
|
252
|
+
assert @xml.external_subset
|
253
|
+
|
254
|
+
assert_raises(RuntimeError) do
|
255
|
+
@xml.create_external_subset('staff', nil, 'staff.dtd')
|
256
|
+
end
|
257
|
+
end
|
258
|
+
|
259
|
+
def test_create_external_subset
|
260
|
+
dtd = @xml.create_external_subset('staff', nil, 'staff.dtd')
|
261
|
+
assert_nil dtd.external_id
|
262
|
+
assert_equal 'staff.dtd', dtd.system_id
|
263
|
+
assert_equal 'staff', dtd.name
|
264
|
+
assert_equal dtd, @xml.external_subset
|
265
|
+
end
|
266
|
+
|
267
|
+
def test_version
|
268
|
+
assert_equal '1.0', @xml.version
|
269
|
+
end
|
270
|
+
|
271
|
+
def test_add_namespace
|
272
|
+
assert_raise NoMethodError do
|
273
|
+
@xml.add_namespace('foo', 'bar')
|
274
|
+
end
|
275
|
+
end
|
276
|
+
|
277
|
+
def test_attributes
|
278
|
+
assert_raise NoMethodError do
|
279
|
+
@xml.attributes
|
280
|
+
end
|
281
|
+
end
|
282
|
+
|
283
|
+
def test_namespace
|
284
|
+
assert_raise NoMethodError do
|
285
|
+
@xml.namespace
|
286
|
+
end
|
287
|
+
end
|
288
|
+
|
289
|
+
def test_namespace_definitions
|
290
|
+
assert_raise NoMethodError do
|
291
|
+
@xml.namespace_definitions
|
292
|
+
end
|
293
|
+
end
|
294
|
+
|
295
|
+
def test_line
|
296
|
+
assert_raise NoMethodError do
|
297
|
+
@xml.line
|
298
|
+
end
|
299
|
+
end
|
300
|
+
|
301
|
+
def test_empty_node_converted_to_html_is_not_self_closing
|
302
|
+
doc = Nokogiri::XML('<a></a>')
|
303
|
+
assert_equal "<a></a>", doc.inner_html
|
304
|
+
end
|
305
|
+
|
306
|
+
def test_fragment
|
307
|
+
fragment = @xml.fragment
|
308
|
+
assert_equal 0, fragment.children.length
|
309
|
+
end
|
310
|
+
|
311
|
+
def test_add_child_fragment_with_single_node
|
312
|
+
doc = Nokogiri::XML::Document.new
|
313
|
+
fragment = doc.fragment('<hello />')
|
314
|
+
doc.add_child fragment
|
315
|
+
assert_equal '/hello', doc.at('//hello').path
|
316
|
+
assert_equal 'hello', doc.root.name
|
317
|
+
end
|
318
|
+
|
319
|
+
def test_add_child_fragment_with_multiple_nodes
|
320
|
+
doc = Nokogiri::XML::Document.new
|
321
|
+
fragment = doc.fragment('<hello /><goodbye />')
|
322
|
+
assert_raises(RuntimeError) do
|
323
|
+
doc.add_child fragment
|
324
|
+
end
|
325
|
+
end
|
326
|
+
|
327
|
+
def test_add_child_with_multiple_roots
|
328
|
+
assert_raises(RuntimeError) do
|
329
|
+
@xml << Node.new('foo', @xml)
|
330
|
+
end
|
331
|
+
end
|
332
|
+
|
333
|
+
def test_add_child_with_string
|
334
|
+
doc = Nokogiri::XML::Document.new
|
335
|
+
doc.add_child "<div>quack!</div>"
|
336
|
+
assert_equal 1, doc.root.children.length
|
337
|
+
assert_equal "quack!", doc.root.children.first.content
|
338
|
+
end
|
339
|
+
|
340
|
+
def test_move_root_to_document_with_no_root
|
341
|
+
sender = Nokogiri::XML('<root>foo</root>')
|
342
|
+
newdoc = Nokogiri::XML::Document.new
|
343
|
+
newdoc.root = sender.root
|
344
|
+
end
|
345
|
+
|
346
|
+
def test_move_root_with_existing_root_gets_gcd
|
347
|
+
doc = Nokogiri::XML('<root>test</root>')
|
348
|
+
doc2 = Nokogiri::XML("<root>#{'x' * 5000000}</root>")
|
349
|
+
doc2.root = doc.root
|
350
|
+
end
|
351
|
+
|
352
|
+
def test_validate
|
353
|
+
if Nokogiri.uses_libxml?
|
354
|
+
assert_equal 44, @xml.validate.length
|
355
|
+
else
|
356
|
+
xml = Nokogiri::XML.parse(File.read(XML_FILE), XML_FILE) {|cfg| cfg.dtdvalid}
|
357
|
+
assert_equal 40, xml.validate.length
|
358
|
+
end
|
359
|
+
end
|
360
|
+
|
361
|
+
def test_validate_no_internal_subset
|
362
|
+
doc = Nokogiri::XML('<test/>')
|
363
|
+
assert_nil doc.validate
|
364
|
+
end
|
365
|
+
|
366
|
+
def test_clone
|
367
|
+
assert @xml.clone
|
368
|
+
end
|
369
|
+
|
370
|
+
def test_document_should_not_have_default_ns
|
371
|
+
doc = Nokogiri::XML::Document.new
|
372
|
+
|
373
|
+
assert_raises NoMethodError do
|
374
|
+
doc.default_namespace = 'http://innernet.com/'
|
375
|
+
end
|
376
|
+
|
377
|
+
assert_raises NoMethodError do
|
378
|
+
doc.add_namespace_definition('foo', 'bar')
|
379
|
+
end
|
380
|
+
end
|
381
|
+
|
382
|
+
def test_parse_handles_nil_gracefully
|
383
|
+
@doc = Nokogiri::XML::Document.parse(nil)
|
384
|
+
assert_instance_of Nokogiri::XML::Document, @doc
|
385
|
+
end
|
386
|
+
|
387
|
+
def test_parse_takes_block
|
388
|
+
options = nil
|
389
|
+
Nokogiri::XML.parse(File.read(XML_FILE), XML_FILE) do |cfg|
|
390
|
+
options = cfg
|
391
|
+
end
|
392
|
+
assert options
|
393
|
+
end
|
394
|
+
|
395
|
+
def test_parse_yields_parse_options
|
396
|
+
options = nil
|
397
|
+
Nokogiri::XML.parse(File.read(XML_FILE), XML_FILE) do |cfg|
|
398
|
+
options = cfg
|
399
|
+
options.nonet.nowarning.dtdattr
|
400
|
+
end
|
401
|
+
assert options.nonet?
|
402
|
+
assert options.nowarning?
|
403
|
+
assert options.dtdattr?
|
404
|
+
end
|
405
|
+
|
406
|
+
def test_XML_takes_block
|
407
|
+
options = nil
|
408
|
+
Nokogiri::XML(File.read(XML_FILE), XML_FILE) do |cfg|
|
409
|
+
options = cfg
|
410
|
+
options.nonet.nowarning.dtdattr
|
411
|
+
end
|
412
|
+
assert options.nonet?
|
413
|
+
assert options.nowarning?
|
414
|
+
assert options.dtdattr?
|
415
|
+
end
|
416
|
+
|
417
|
+
def test_subclass
|
418
|
+
klass = Class.new(Nokogiri::XML::Document)
|
419
|
+
doc = klass.new
|
420
|
+
assert_instance_of klass, doc
|
421
|
+
end
|
422
|
+
|
423
|
+
def test_subclass_initialize
|
424
|
+
klass = Class.new(Nokogiri::XML::Document) do
|
425
|
+
attr_accessor :initialized_with
|
426
|
+
|
427
|
+
def initialize(*args)
|
428
|
+
@initialized_with = args
|
429
|
+
end
|
430
|
+
end
|
431
|
+
doc = klass.new("1.0", 1)
|
432
|
+
assert_equal ["1.0", 1], doc.initialized_with
|
433
|
+
end
|
434
|
+
|
435
|
+
def test_subclass_dup
|
436
|
+
klass = Class.new(Nokogiri::XML::Document)
|
437
|
+
doc = klass.new.dup
|
438
|
+
assert_instance_of klass, doc
|
439
|
+
end
|
440
|
+
|
441
|
+
def test_subclass_parse
|
442
|
+
klass = Class.new(Nokogiri::XML::Document)
|
443
|
+
doc = klass.parse(File.read(XML_FILE))
|
444
|
+
# lame hack uses root to avoid comparing DOCTYPE tags which can appear out of order.
|
445
|
+
# I should really finish lorax and use that here.
|
446
|
+
assert_equal @xml.root.to_s, doc.root.to_s
|
447
|
+
assert_instance_of klass, doc
|
448
|
+
end
|
449
|
+
|
450
|
+
def test_document_parse_method
|
451
|
+
xml = Nokogiri::XML::Document.parse(File.read(XML_FILE))
|
452
|
+
# lame hack uses root to avoid comparing DOCTYPE tags which can appear out of order.
|
453
|
+
# I should really finish lorax and use that here.
|
454
|
+
assert_equal @xml.root.to_s, xml.root.to_s
|
455
|
+
end
|
456
|
+
|
457
|
+
def test_encoding=
|
458
|
+
@xml.encoding = 'UTF-8'
|
459
|
+
assert_match 'UTF-8', @xml.to_xml
|
460
|
+
|
461
|
+
@xml.encoding = 'EUC-JP'
|
462
|
+
assert_match 'EUC-JP', @xml.to_xml
|
463
|
+
end
|
464
|
+
|
465
|
+
def test_namespace_should_not_exist
|
466
|
+
assert_raises(NoMethodError) {
|
467
|
+
@xml.namespace
|
468
|
+
}
|
469
|
+
end
|
470
|
+
|
471
|
+
def test_non_existant_function
|
472
|
+
# WTF. I don't know why this is different between MRI and Jruby
|
473
|
+
# They should be the same... Either way, raising an exception
|
474
|
+
# is the correct thing to do.
|
475
|
+
exception = RuntimeError
|
476
|
+
|
477
|
+
if !Nokogiri.uses_libxml? || (Nokogiri.uses_libxml? && Nokogiri::VERSION_INFO['libxml']['platform'] == 'jruby')
|
478
|
+
exception = Nokogiri::XML::XPath::SyntaxError
|
479
|
+
end
|
480
|
+
|
481
|
+
assert_raises(exception) {
|
482
|
+
@xml.xpath('//name[foo()]')
|
483
|
+
}
|
484
|
+
end
|
485
|
+
|
486
|
+
def test_ancestors
|
487
|
+
assert_equal 0, @xml.ancestors.length
|
488
|
+
end
|
489
|
+
|
490
|
+
def test_root_node_parent_is_document
|
491
|
+
parent = @xml.root.parent
|
492
|
+
assert_equal @xml, parent
|
493
|
+
assert_instance_of Nokogiri::XML::Document, parent
|
494
|
+
end
|
495
|
+
|
496
|
+
def test_xmlns_is_automatically_registered
|
497
|
+
doc = Nokogiri::XML(<<-eoxml)
|
498
|
+
<root xmlns="http://tenderlovemaking.com/">
|
499
|
+
<foo>
|
500
|
+
bar
|
501
|
+
</foo>
|
502
|
+
</root>
|
503
|
+
eoxml
|
504
|
+
assert_equal 1, doc.css('xmlns|foo').length
|
505
|
+
assert_equal 1, doc.css('foo').length
|
506
|
+
assert_equal 0, doc.css('|foo').length
|
507
|
+
assert_equal 1, doc.xpath('//xmlns:foo').length
|
508
|
+
assert_equal 1, doc.search('xmlns|foo').length
|
509
|
+
assert_equal 1, doc.search('//xmlns:foo').length
|
510
|
+
assert doc.at('xmlns|foo')
|
511
|
+
assert doc.at('//xmlns:foo')
|
512
|
+
assert doc.at('foo')
|
513
|
+
end
|
514
|
+
|
515
|
+
def test_xmlns_is_registered_for_nodesets
|
516
|
+
doc = Nokogiri::XML(<<-eoxml)
|
517
|
+
<root xmlns="http://tenderlovemaking.com/">
|
518
|
+
<foo>
|
519
|
+
<bar>
|
520
|
+
baz
|
521
|
+
</bar>
|
522
|
+
</foo>
|
523
|
+
</root>
|
524
|
+
eoxml
|
525
|
+
assert_equal 1, doc.css('xmlns|foo').css('xmlns|bar').length
|
526
|
+
assert_equal 1, doc.css('foo').css('bar').length
|
527
|
+
assert_equal 1, doc.xpath('//xmlns:foo').xpath('./xmlns:bar').length
|
528
|
+
assert_equal 1, doc.search('xmlns|foo').search('xmlns|bar').length
|
529
|
+
assert_equal 1, doc.search('//xmlns:foo').search('./xmlns:bar').length
|
530
|
+
end
|
531
|
+
|
532
|
+
def test_to_xml_with_indent
|
533
|
+
doc = Nokogiri::XML('<root><foo><bar/></foo></root>')
|
534
|
+
doc = Nokogiri::XML(doc.to_xml(:indent => 5))
|
535
|
+
|
536
|
+
assert_indent 5, doc
|
537
|
+
end
|
538
|
+
|
539
|
+
def test_write_xml_to_with_indent
|
540
|
+
io = StringIO.new
|
541
|
+
doc = Nokogiri::XML('<root><foo><bar/></foo></root>')
|
542
|
+
doc.write_xml_to io, :indent => 5
|
543
|
+
io.rewind
|
544
|
+
doc = Nokogiri::XML(io.read)
|
545
|
+
assert_indent 5, doc
|
546
|
+
end
|
547
|
+
|
548
|
+
# wtf... osx's libxml sucks.
|
549
|
+
unless !Nokogiri.uses_libxml? || Nokogiri::LIBXML_VERSION =~ /^2\.6\./
|
550
|
+
def test_encoding
|
551
|
+
xml = Nokogiri::XML(File.read(XML_FILE), XML_FILE, 'UTF-8')
|
552
|
+
assert_equal 'UTF-8', xml.encoding
|
553
|
+
end
|
554
|
+
end
|
555
|
+
|
556
|
+
def test_memory_explosion_on_invalid_xml
|
557
|
+
doc = Nokogiri::XML("<<<")
|
558
|
+
refute_nil doc
|
559
|
+
refute_empty doc.errors
|
560
|
+
end
|
561
|
+
|
562
|
+
def test_document_has_errors
|
563
|
+
doc = Nokogiri::XML(<<-eoxml)
|
564
|
+
<foo><bar></foo>
|
565
|
+
eoxml
|
566
|
+
assert doc.errors.length > 0
|
567
|
+
doc.errors.each do |error|
|
568
|
+
assert_match error.message, error.inspect
|
569
|
+
assert_match error.message, error.to_s
|
570
|
+
end
|
571
|
+
end
|
572
|
+
|
573
|
+
def test_strict_document_throws_syntax_error
|
574
|
+
assert_raises(Nokogiri::XML::SyntaxError) {
|
575
|
+
Nokogiri::XML('<foo><bar></foo>', nil, nil, 0)
|
576
|
+
}
|
577
|
+
|
578
|
+
assert_raises(Nokogiri::XML::SyntaxError) {
|
579
|
+
Nokogiri::XML('<foo><bar></foo>') { |cfg|
|
580
|
+
cfg.strict
|
581
|
+
}
|
582
|
+
}
|
583
|
+
|
584
|
+
assert_raises(Nokogiri::XML::SyntaxError) {
|
585
|
+
Nokogiri::XML(StringIO.new('<foo><bar></foo>')) { |cfg|
|
586
|
+
cfg.strict
|
587
|
+
}
|
588
|
+
}
|
589
|
+
end
|
590
|
+
|
591
|
+
def test_XML_function
|
592
|
+
xml = Nokogiri::XML(File.read(XML_FILE), XML_FILE)
|
593
|
+
assert xml.xml?
|
594
|
+
end
|
595
|
+
|
596
|
+
def test_url
|
597
|
+
assert @xml.url
|
598
|
+
assert_equal XML_FILE, URI.unescape(@xml.url).sub('file:///', '')
|
599
|
+
end
|
600
|
+
|
601
|
+
def test_document_parent
|
602
|
+
xml = Nokogiri::XML(File.read(XML_FILE), XML_FILE)
|
603
|
+
assert_raises(NoMethodError) {
|
604
|
+
xml.parent
|
605
|
+
}
|
606
|
+
end
|
607
|
+
|
608
|
+
def test_document_name
|
609
|
+
xml = Nokogiri::XML(File.read(XML_FILE), XML_FILE)
|
610
|
+
assert_equal 'document', xml.name
|
611
|
+
end
|
612
|
+
|
613
|
+
def test_parse_can_take_io
|
614
|
+
xml = nil
|
615
|
+
File.open(XML_FILE, 'rb') { |f|
|
616
|
+
xml = Nokogiri::XML(f)
|
617
|
+
}
|
618
|
+
assert xml.xml?
|
619
|
+
set = xml.search('//employee')
|
620
|
+
assert set.length > 0
|
621
|
+
end
|
622
|
+
|
623
|
+
def test_parsing_empty_io
|
624
|
+
doc = Nokogiri::XML.parse(StringIO.new(''))
|
625
|
+
refute_nil doc
|
626
|
+
end
|
627
|
+
|
628
|
+
def test_search_on_empty_documents
|
629
|
+
doc = Nokogiri::XML::Document.new
|
630
|
+
ns = doc.search('//foo')
|
631
|
+
assert_equal 0, ns.length
|
632
|
+
|
633
|
+
ns = doc.css('foo')
|
634
|
+
assert_equal 0, ns.length
|
635
|
+
|
636
|
+
ns = doc.xpath('//foo')
|
637
|
+
assert_equal 0, ns.length
|
638
|
+
end
|
639
|
+
|
640
|
+
def test_bad_xpath_raises_syntax_error
|
641
|
+
assert_raises(XML::XPath::SyntaxError) {
|
642
|
+
@xml.xpath('\\')
|
643
|
+
}
|
644
|
+
end
|
645
|
+
|
646
|
+
def test_find_with_namespace
|
647
|
+
doc = Nokogiri::XML.parse(<<-eoxml)
|
648
|
+
<x xmlns:tenderlove='http://tenderlovemaking.com/'>
|
649
|
+
<tenderlove:foo awesome='true'>snuggles!</tenderlove:foo>
|
650
|
+
</x>
|
651
|
+
eoxml
|
652
|
+
|
653
|
+
ctx = Nokogiri::XML::XPathContext.new(doc)
|
654
|
+
ctx.register_ns 'tenderlove', 'http://tenderlovemaking.com/'
|
655
|
+
set = ctx.evaluate('//tenderlove:foo')
|
656
|
+
assert_equal 1, set.length
|
657
|
+
assert_equal 'foo', set.first.name
|
658
|
+
|
659
|
+
# It looks like only the URI is important:
|
660
|
+
ctx = Nokogiri::XML::XPathContext.new(doc)
|
661
|
+
ctx.register_ns 'america', 'http://tenderlovemaking.com/'
|
662
|
+
set = ctx.evaluate('//america:foo')
|
663
|
+
assert_equal 1, set.length
|
664
|
+
assert_equal 'foo', set.first.name
|
665
|
+
|
666
|
+
# Its so important that a missing slash will cause it to return nothing
|
667
|
+
ctx = Nokogiri::XML::XPathContext.new(doc)
|
668
|
+
ctx.register_ns 'america', 'http://tenderlovemaking.com'
|
669
|
+
set = ctx.evaluate('//america:foo')
|
670
|
+
assert_equal 0, set.length
|
671
|
+
end
|
672
|
+
|
673
|
+
def test_xml?
|
674
|
+
assert @xml.xml?
|
675
|
+
end
|
676
|
+
|
677
|
+
def test_document
|
678
|
+
assert @xml.document
|
679
|
+
end
|
680
|
+
|
681
|
+
def test_singleton_methods
|
682
|
+
assert node_set = @xml.search('//name')
|
683
|
+
assert node_set.length > 0
|
684
|
+
node = node_set.first
|
685
|
+
def node.test
|
686
|
+
'test'
|
687
|
+
end
|
688
|
+
assert node_set = @xml.search('//name')
|
689
|
+
assert_equal 'test', node_set.first.test
|
690
|
+
end
|
691
|
+
|
692
|
+
def test_multiple_search
|
693
|
+
assert node_set = @xml.search('//employee', '//name')
|
694
|
+
employees = @xml.search('//employee')
|
695
|
+
names = @xml.search('//name')
|
696
|
+
assert_equal(employees.length + names.length, node_set.length)
|
697
|
+
end
|
698
|
+
|
699
|
+
def test_node_set_index
|
700
|
+
assert node_set = @xml.search('//employee')
|
701
|
+
|
702
|
+
assert_equal(5, node_set.length)
|
703
|
+
assert node_set[4]
|
704
|
+
assert_nil node_set[5]
|
705
|
+
end
|
706
|
+
|
707
|
+
def test_search
|
708
|
+
assert node_set = @xml.search('//employee')
|
709
|
+
|
710
|
+
assert_equal(5, node_set.length)
|
711
|
+
|
712
|
+
node_set.each do |node|
|
713
|
+
assert_equal('employee', node.name)
|
714
|
+
end
|
715
|
+
end
|
716
|
+
|
717
|
+
def test_dump
|
718
|
+
assert @xml.serialize
|
719
|
+
assert @xml.to_xml
|
720
|
+
end
|
721
|
+
|
722
|
+
def test_dup
|
723
|
+
dup = @xml.dup
|
724
|
+
assert_instance_of Nokogiri::XML::Document, dup
|
725
|
+
assert dup.xml?, 'duplicate should be xml'
|
726
|
+
end
|
727
|
+
|
728
|
+
def test_new
|
729
|
+
doc = nil
|
730
|
+
doc = Nokogiri::XML::Document.new
|
731
|
+
assert doc
|
732
|
+
assert doc.xml?
|
733
|
+
assert_nil doc.root
|
734
|
+
end
|
735
|
+
|
736
|
+
def test_set_root
|
737
|
+
doc = nil
|
738
|
+
doc = Nokogiri::XML::Document.new
|
739
|
+
assert doc
|
740
|
+
assert doc.xml?
|
741
|
+
assert_nil doc.root
|
742
|
+
node = Nokogiri::XML::Node.new("b", doc) { |n|
|
743
|
+
n.content = 'hello world'
|
744
|
+
}
|
745
|
+
assert_equal('hello world', node.content)
|
746
|
+
doc.root = node
|
747
|
+
assert_equal(node, doc.root)
|
748
|
+
end
|
749
|
+
|
750
|
+
def test_remove_namespaces
|
751
|
+
doc = Nokogiri::XML <<-EOX
|
752
|
+
<root xmlns:a="http://a.flavorjon.es/" xmlns:b="http://b.flavorjon.es/">
|
753
|
+
<a:foo>hello from a</a:foo>
|
754
|
+
<b:foo>hello from b</b:foo>
|
755
|
+
<container xmlns:c="http://c.flavorjon.es/">
|
756
|
+
<c:foo c:attr='attr-value'>hello from c</c:foo>
|
757
|
+
</container>
|
758
|
+
</root>
|
759
|
+
EOX
|
760
|
+
|
761
|
+
namespaces = doc.root.namespaces
|
762
|
+
|
763
|
+
# assert on setup
|
764
|
+
assert_equal 2, doc.root.namespaces.length
|
765
|
+
assert_equal 3, doc.at_xpath("//container").namespaces.length
|
766
|
+
assert_equal 0, doc.xpath("//foo").length
|
767
|
+
assert_equal 1, doc.xpath("//a:foo").length
|
768
|
+
assert_equal 1, doc.xpath("//a:foo").length
|
769
|
+
assert_equal 1, doc.xpath("//x:foo", "x" => "http://c.flavorjon.es/").length
|
770
|
+
assert_match %r{foo c:attr}, doc.to_xml
|
771
|
+
|
772
|
+
doc.remove_namespaces!
|
773
|
+
|
774
|
+
assert_equal 0, doc.root.namespaces.length
|
775
|
+
assert_equal 0, doc.at_xpath("//container").namespaces.length
|
776
|
+
assert_equal 3, doc.xpath("//foo").length
|
777
|
+
assert_equal 0, doc.xpath("//a:foo", namespaces).length
|
778
|
+
assert_equal 0, doc.xpath("//a:foo", namespaces).length
|
779
|
+
assert_equal 0, doc.xpath("//x:foo", "x" => "http://c.flavorjon.es/").length
|
780
|
+
assert_match %r{foo attr}, doc.to_xml
|
781
|
+
end
|
782
|
+
|
783
|
+
# issue #785
|
784
|
+
def test_attribute_decoration
|
785
|
+
decorator = Module.new do
|
786
|
+
def test_method
|
787
|
+
end
|
788
|
+
end
|
789
|
+
|
790
|
+
util_decorate(@xml, decorator)
|
791
|
+
|
792
|
+
assert @xml.search('//@street').first.respond_to?(:test_method)
|
793
|
+
end
|
794
|
+
|
795
|
+
def test_subset_is_decorated
|
796
|
+
x = Module.new do
|
797
|
+
def awesome!
|
798
|
+
end
|
799
|
+
end
|
800
|
+
util_decorate(@xml, x)
|
801
|
+
|
802
|
+
assert @xml.respond_to?(:awesome!)
|
803
|
+
assert node_set = @xml.search('//staff')
|
804
|
+
assert node_set.respond_to?(:awesome!)
|
805
|
+
assert subset = node_set.search('.//employee')
|
806
|
+
assert subset.respond_to?(:awesome!)
|
807
|
+
assert sub_subset = node_set.search('.//name')
|
808
|
+
assert sub_subset.respond_to?(:awesome!)
|
809
|
+
end
|
810
|
+
|
811
|
+
def test_decorator_is_applied
|
812
|
+
x = Module.new do
|
813
|
+
def awesome!
|
814
|
+
end
|
815
|
+
end
|
816
|
+
util_decorate(@xml, x)
|
817
|
+
|
818
|
+
assert @xml.respond_to?(:awesome!)
|
819
|
+
assert node_set = @xml.search('//employee')
|
820
|
+
assert node_set.respond_to?(:awesome!)
|
821
|
+
node_set.each do |node|
|
822
|
+
assert node.respond_to?(:awesome!), node.class
|
823
|
+
end
|
824
|
+
assert @xml.root.respond_to?(:awesome!)
|
825
|
+
assert @xml.children.respond_to?(:awesome!)
|
826
|
+
end
|
827
|
+
|
828
|
+
if Nokogiri.jruby?
|
829
|
+
def wrap_java_document
|
830
|
+
require 'java'
|
831
|
+
factory = javax.xml.parsers.DocumentBuilderFactory.newInstance
|
832
|
+
builder = factory.newDocumentBuilder
|
833
|
+
document = builder.newDocument
|
834
|
+
root = document.createElement("foo")
|
835
|
+
document.appendChild(root)
|
836
|
+
Nokogiri::XML::Document.wrap(document)
|
837
|
+
end
|
838
|
+
end
|
839
|
+
|
840
|
+
def test_java_integration
|
841
|
+
skip("Ruby doesn't have the wrap method") unless Nokogiri.jruby?
|
842
|
+
noko_doc = wrap_java_document
|
843
|
+
assert_equal 'foo', noko_doc.root.name
|
844
|
+
|
845
|
+
noko_doc = Nokogiri::XML(<<eoxml)
|
846
|
+
<foo xmlns='hello'>
|
847
|
+
<bar xmlns:foo='world' />
|
848
|
+
</foo>
|
849
|
+
eoxml
|
850
|
+
dom = noko_doc.to_java
|
851
|
+
assert dom.kind_of? org.w3c.dom.Document
|
852
|
+
assert_equal 'foo', dom.getDocumentElement().getTagName()
|
853
|
+
end
|
854
|
+
|
855
|
+
def test_add_child
|
856
|
+
skip("Ruby doesn't have the wrap method") unless Nokogiri.jruby?
|
857
|
+
doc = wrap_java_document
|
858
|
+
doc.root.add_child "<bar />"
|
859
|
+
end
|
860
|
+
|
861
|
+
def test_can_be_closed
|
862
|
+
f = File.open XML_FILE
|
863
|
+
Nokogiri::XML f
|
864
|
+
f.close
|
865
|
+
end
|
866
|
+
end
|
867
|
+
end
|
868
|
+
end
|