nokogiri 1.8.5-java → 1.9.0-java

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.

Files changed (160) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +0 -1
  3. data/ext/java/nokogiri/XmlAttr.java +3 -1
  4. data/ext/java/nokogiri/XmlDtd.java +20 -16
  5. data/ext/java/nokogiri/XmlElement.java +6 -6
  6. data/ext/java/nokogiri/XmlNode.java +29 -9
  7. data/ext/java/nokogiri/XmlNodeSet.java +258 -77
  8. data/ext/java/nokogiri/XmlXpathContext.java +10 -12
  9. data/ext/java/nokogiri/internals/NokogiriHelpers.java +25 -23
  10. data/ext/java/nokogiri/internals/NokogiriXPathFunction.java +5 -5
  11. data/ext/java/nokogiri/internals/XalanDTMManagerPatch.java +11 -10
  12. data/ext/java/{org/apache/xml/dtm/ref/dom2dtm/DOM2DTMExt.java → nokogiri/internals/dom2dtm/DOM2DTM.java} +3 -7
  13. data/ext/java/nokogiri/internals/dom2dtm/DOM2DTMdefaultNamespaceDeclarationNode.java +685 -0
  14. data/ext/nokogiri/extconf.rb +10 -6
  15. data/ext/nokogiri/xml_attr.c +26 -21
  16. data/ext/nokogiri/xml_document.c +4 -1
  17. data/ext/nokogiri/xml_namespace.c +3 -3
  18. data/ext/nokogiri/xml_namespace.h +1 -2
  19. data/ext/nokogiri/xml_node.c +55 -15
  20. data/lib/nokogiri/css/parser.rb +61 -61
  21. data/lib/nokogiri/nokogiri.jar +0 -0
  22. data/lib/nokogiri/version.rb +1 -1
  23. data/lib/nokogiri/xml/document_fragment.rb +11 -0
  24. data/lib/nokogiri/xml/node.rb +12 -0
  25. data/lib/nokogiri/xml/node_set.rb +4 -8
  26. data/lib/xercesImpl.jar +0 -0
  27. metadata +17 -152
  28. data/.autotest +0 -22
  29. data/.cross_rubies +0 -8
  30. data/.editorconfig +0 -17
  31. data/.gemtest +0 -0
  32. data/.travis.yml +0 -63
  33. data/CHANGELOG.md +0 -1368
  34. data/CONTRIBUTING.md +0 -42
  35. data/C_CODING_STYLE.rdoc +0 -33
  36. data/Gemfile +0 -23
  37. data/Gemfile-libxml-ruby +0 -3
  38. data/Manifest.txt +0 -370
  39. data/ROADMAP.md +0 -111
  40. data/Rakefile +0 -348
  41. data/SECURITY.md +0 -19
  42. data/STANDARD_RESPONSES.md +0 -47
  43. data/Y_U_NO_GEMSPEC.md +0 -155
  44. data/appveyor.yml +0 -29
  45. data/build_all +0 -44
  46. data/patches/sort-patches-by-date +0 -25
  47. data/suppressions/README.txt +0 -1
  48. data/suppressions/nokogiri_ruby-2.supp +0 -10
  49. data/tasks/test.rb +0 -100
  50. data/test/css/test_nthiness.rb +0 -226
  51. data/test/css/test_parser.rb +0 -386
  52. data/test/css/test_tokenizer.rb +0 -215
  53. data/test/css/test_xpath_visitor.rb +0 -96
  54. data/test/decorators/test_slop.rb +0 -23
  55. data/test/files/2ch.html +0 -108
  56. data/test/files/GH_1042.html +0 -18
  57. data/test/files/address_book.rlx +0 -12
  58. data/test/files/address_book.xml +0 -10
  59. data/test/files/atom.xml +0 -344
  60. data/test/files/bar/bar.xsd +0 -4
  61. data/test/files/bogus.xml +0 -0
  62. data/test/files/dont_hurt_em_why.xml +0 -422
  63. data/test/files/encoding.html +0 -82
  64. data/test/files/encoding.xhtml +0 -84
  65. data/test/files/exslt.xml +0 -8
  66. data/test/files/exslt.xslt +0 -35
  67. data/test/files/foo/foo.xsd +0 -4
  68. data/test/files/metacharset.html +0 -10
  69. data/test/files/namespace_pressure_test.xml +0 -1684
  70. data/test/files/noencoding.html +0 -47
  71. data/test/files/po.xml +0 -32
  72. data/test/files/po.xsd +0 -66
  73. data/test/files/saml/saml20assertion_schema.xsd +0 -283
  74. data/test/files/saml/saml20protocol_schema.xsd +0 -302
  75. data/test/files/saml/xenc_schema.xsd +0 -146
  76. data/test/files/saml/xmldsig_schema.xsd +0 -318
  77. data/test/files/shift_jis.html +0 -10
  78. data/test/files/shift_jis.xml +0 -5
  79. data/test/files/shift_jis_no_charset.html +0 -9
  80. data/test/files/slow-xpath.xml +0 -25509
  81. data/test/files/snuggles.xml +0 -3
  82. data/test/files/staff.dtd +0 -10
  83. data/test/files/staff.xml +0 -59
  84. data/test/files/staff.xslt +0 -32
  85. data/test/files/test_document_url/bar.xml +0 -2
  86. data/test/files/test_document_url/document.dtd +0 -4
  87. data/test/files/test_document_url/document.xml +0 -6
  88. data/test/files/tlm.html +0 -851
  89. data/test/files/to_be_xincluded.xml +0 -2
  90. data/test/files/valid_bar.xml +0 -2
  91. data/test/files/xinclude.xml +0 -4
  92. data/test/helper.rb +0 -271
  93. data/test/html/sax/test_parser.rb +0 -168
  94. data/test/html/sax/test_parser_context.rb +0 -46
  95. data/test/html/sax/test_parser_text.rb +0 -163
  96. data/test/html/sax/test_push_parser.rb +0 -87
  97. data/test/html/test_attributes.rb +0 -85
  98. data/test/html/test_builder.rb +0 -164
  99. data/test/html/test_document.rb +0 -712
  100. data/test/html/test_document_encoding.rb +0 -143
  101. data/test/html/test_document_fragment.rb +0 -310
  102. data/test/html/test_element_description.rb +0 -105
  103. data/test/html/test_named_characters.rb +0 -14
  104. data/test/html/test_node.rb +0 -212
  105. data/test/html/test_node_encoding.rb +0 -91
  106. data/test/namespaces/test_additional_namespaces_in_builder_doc.rb +0 -14
  107. data/test/namespaces/test_namespaces_aliased_default.rb +0 -24
  108. data/test/namespaces/test_namespaces_in_builder_doc.rb +0 -75
  109. data/test/namespaces/test_namespaces_in_cloned_doc.rb +0 -31
  110. data/test/namespaces/test_namespaces_in_created_doc.rb +0 -75
  111. data/test/namespaces/test_namespaces_in_parsed_doc.rb +0 -80
  112. data/test/namespaces/test_namespaces_preservation.rb +0 -31
  113. data/test/test_convert_xpath.rb +0 -135
  114. data/test/test_css_cache.rb +0 -47
  115. data/test/test_encoding_handler.rb +0 -48
  116. data/test/test_memory_leak.rb +0 -156
  117. data/test/test_nokogiri.rb +0 -138
  118. data/test/test_soap4r_sax.rb +0 -52
  119. data/test/test_xslt_transforms.rb +0 -314
  120. data/test/xml/node/test_save_options.rb +0 -28
  121. data/test/xml/node/test_subclass.rb +0 -44
  122. data/test/xml/sax/test_parser.rb +0 -402
  123. data/test/xml/sax/test_parser_context.rb +0 -115
  124. data/test/xml/sax/test_parser_text.rb +0 -202
  125. data/test/xml/sax/test_push_parser.rb +0 -265
  126. data/test/xml/test_attr.rb +0 -74
  127. data/test/xml/test_attribute_decl.rb +0 -86
  128. data/test/xml/test_builder.rb +0 -341
  129. data/test/xml/test_c14n.rb +0 -180
  130. data/test/xml/test_cdata.rb +0 -54
  131. data/test/xml/test_comment.rb +0 -40
  132. data/test/xml/test_document.rb +0 -982
  133. data/test/xml/test_document_encoding.rb +0 -31
  134. data/test/xml/test_document_fragment.rb +0 -298
  135. data/test/xml/test_dtd.rb +0 -187
  136. data/test/xml/test_dtd_encoding.rb +0 -31
  137. data/test/xml/test_element_content.rb +0 -56
  138. data/test/xml/test_element_decl.rb +0 -73
  139. data/test/xml/test_entity_decl.rb +0 -122
  140. data/test/xml/test_entity_reference.rb +0 -262
  141. data/test/xml/test_namespace.rb +0 -96
  142. data/test/xml/test_node.rb +0 -1325
  143. data/test/xml/test_node_attributes.rb +0 -115
  144. data/test/xml/test_node_encoding.rb +0 -75
  145. data/test/xml/test_node_inheritance.rb +0 -32
  146. data/test/xml/test_node_reparenting.rb +0 -592
  147. data/test/xml/test_node_set.rb +0 -809
  148. data/test/xml/test_parse_options.rb +0 -64
  149. data/test/xml/test_processing_instruction.rb +0 -30
  150. data/test/xml/test_reader.rb +0 -620
  151. data/test/xml/test_reader_encoding.rb +0 -134
  152. data/test/xml/test_relax_ng.rb +0 -60
  153. data/test/xml/test_schema.rb +0 -142
  154. data/test/xml/test_syntax_error.rb +0 -36
  155. data/test/xml/test_text.rb +0 -60
  156. data/test/xml/test_unparented_node.rb +0 -483
  157. data/test/xml/test_xinclude.rb +0 -83
  158. data/test/xml/test_xpath.rb +0 -470
  159. data/test/xslt/test_custom_functions.rb +0 -133
  160. data/test/xslt/test_exception_handling.rb +0 -37
@@ -1,133 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
-
3
- require "helper"
4
-
5
- module Nokogiri
6
- module XSLT
7
- class TestCustomFunctions < Nokogiri::TestCase
8
- def setup
9
- super
10
- @xml = Nokogiri.XML(<<-EOXML)
11
- <?xml version="1.0" encoding="UTF-8"?>
12
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN"
13
- "http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd">
14
- <html xmlns="http://www.w3.org/1999/xhtml" lang="en">
15
- <head>
16
- <meta http-equiv="Content-type" content="application/xhtml+xml"/>
17
- <title>Foo</title>
18
- </head>
19
- <body>
20
- <h1>Foo</h1>
21
- <p>Lorem ipsum.</p>
22
- </body>
23
- </html>
24
- EOXML
25
- end
26
-
27
- def test_function
28
- skip("Pure Java version doesn't support this feature.") if !Nokogiri.uses_libxml?
29
- foo = Class.new do
30
- def capitalize nodes
31
- nodes.first.content.upcase
32
- end
33
- end
34
-
35
- XSLT.register "http://e.org/functions", foo
36
-
37
- xsl = Nokogiri.XSLT(<<-EOXSL)
38
- <?xml version="1.0"?>
39
- <xsl:stylesheet version="1.0"
40
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
41
- xmlns:f="http://e.org/functions"
42
- extension-element-prefixes="f">
43
-
44
- <xsl:template match="text()">
45
- <xsl:copy-of select="f:capitalize(.)"/>
46
- </xsl:template>
47
-
48
- <xsl:template match="@*|node()">
49
- <xsl:copy>
50
- <xsl:apply-templates select="@*|node()"/>
51
- <xsl:apply-imports/>
52
- </xsl:copy>
53
- </xsl:template>
54
-
55
- </xsl:stylesheet>
56
- EOXSL
57
- result = xsl.transform @xml
58
- assert_match(/FOO/, result.css('title').first.text)
59
- end
60
-
61
-
62
- def test_function_arguments
63
- skip("Pure Java version doesn't support this feature.") if !Nokogiri.uses_libxml?
64
- foo = Class.new do
65
- include MiniTest::Assertions
66
- # Minitest 5 uses `self.assertions` in `assert()` which is not
67
- # defined in the Minitest::Assertions module :-(
68
- attr_writer :assertions
69
- def assertions; @assertions ||= 0; end
70
-
71
- def multiarg *args
72
- assert_equal ["abc", "xyz"], args
73
- args.first
74
- end
75
-
76
- def numericarg arg
77
- assert_equal 42, arg
78
- arg
79
- end
80
- end
81
-
82
- xsl = Nokogiri.XSLT(<<-EOXSL, "http://e.org/functions" => foo)
83
- <?xml version="1.0"?>
84
- <xsl:stylesheet version="1.0"
85
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
86
- xmlns:f="http://e.org/functions"
87
- extension-element-prefixes="f">
88
-
89
- <xsl:template match="text()">
90
- <xsl:copy-of select="f:multiarg('abc', 'xyz')"/>
91
- <xsl:copy-of select="f:numericarg(42)"/>
92
- </xsl:template>
93
- </xsl:stylesheet>
94
- EOXSL
95
-
96
- xsl.transform @xml
97
- end
98
-
99
-
100
- def test_function_XSLT
101
- skip("Pure Java version doesn't support this feature.") if !Nokogiri.uses_libxml?
102
- foo = Class.new do
103
- def america nodes
104
- nodes.first.content.upcase
105
- end
106
- end
107
-
108
- xsl = Nokogiri.XSLT(<<-EOXSL, "http://e.org/functions" => foo)
109
- <?xml version="1.0"?>
110
- <xsl:stylesheet version="1.0"
111
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
112
- xmlns:f="http://e.org/functions"
113
- extension-element-prefixes="f">
114
-
115
- <xsl:template match="text()">
116
- <xsl:copy-of select="f:america(.)"/>
117
- </xsl:template>
118
-
119
- <xsl:template match="@*|node()">
120
- <xsl:copy>
121
- <xsl:apply-templates select="@*|node()"/>
122
- <xsl:apply-imports/>
123
- </xsl:copy>
124
- </xsl:template>
125
-
126
- </xsl:stylesheet>
127
- EOXSL
128
- result = xsl.transform @xml
129
- assert_match(/FOO/, result.css('title').first.text)
130
- end
131
- end
132
- end
133
- end
@@ -1,37 +0,0 @@
1
- require "helper"
2
-
3
- module Nokogiri
4
- module XSLT
5
- class TestExceptionHandling < Nokogiri::TestCase
6
- def test_java_exception_handling
7
- skip('This test is for Java only') if Nokogiri.uses_libxml?
8
-
9
- xml = Nokogiri.XML(<<-EOXML)
10
- <foo>
11
- <bar/>
12
- </foo>
13
- EOXML
14
-
15
- xsl = Nokogiri.XSLT(<<-EOXSL)
16
- <?xml version="1.0"?>
17
- <xsl:stylesheet version="1.0"
18
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
19
-
20
- <xsl:template match="/">
21
- <a/>
22
- <b/>
23
- </xsl:template>
24
- </xsl:stylesheet>
25
- EOXSL
26
-
27
- begin
28
- xsl.transform xml
29
- fail('It should not get here')
30
- rescue RuntimeError => e
31
- assert_match(/Can't have more than one root/, e.to_s, 'The exception message does not contain the expected information')
32
- end
33
- end
34
-
35
- end
36
- end
37
- end