nokogiri 1.4.1-java → 1.4.2-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 (115) hide show
  1. data/CHANGELOG.ja.rdoc +45 -0
  2. data/CHANGELOG.rdoc +53 -1
  3. data/Manifest.txt +3 -3
  4. data/README.ja.rdoc +1 -1
  5. data/README.rdoc +11 -5
  6. data/Rakefile +13 -79
  7. data/ext/nokogiri/extconf.rb +22 -74
  8. data/ext/nokogiri/html_document.c +17 -8
  9. data/ext/nokogiri/html_element_description.c +20 -16
  10. data/ext/nokogiri/html_entity_lookup.c +2 -2
  11. data/ext/nokogiri/html_sax_parser_context.c +10 -8
  12. data/ext/nokogiri/libcharset-1.dll +0 -0
  13. data/ext/nokogiri/libexslt.dll +0 -0
  14. data/ext/nokogiri/libiconv-2.dll +0 -0
  15. data/ext/nokogiri/libxml2.dll +0 -0
  16. data/ext/nokogiri/libxslt.dll +0 -0
  17. data/ext/nokogiri/nokogiri.c +0 -1
  18. data/ext/nokogiri/nokogiri.h +33 -28
  19. data/ext/nokogiri/xml_attr.c +7 -5
  20. data/ext/nokogiri/xml_attribute_decl.c +5 -2
  21. data/ext/nokogiri/xml_cdata.c +4 -2
  22. data/ext/nokogiri/xml_comment.c +4 -2
  23. data/ext/nokogiri/xml_document.c +93 -15
  24. data/ext/nokogiri/xml_document.h +0 -1
  25. data/ext/nokogiri/xml_document_fragment.c +4 -2
  26. data/ext/nokogiri/xml_dtd.c +18 -8
  27. data/ext/nokogiri/xml_element_content.c +2 -2
  28. data/ext/nokogiri/xml_entity_decl.c +15 -2
  29. data/ext/nokogiri/xml_entity_reference.c +4 -2
  30. data/ext/nokogiri/xml_io.c +1 -1
  31. data/ext/nokogiri/xml_namespace.c +5 -3
  32. data/ext/nokogiri/xml_node.c +353 -114
  33. data/ext/nokogiri/xml_node_set.c +35 -22
  34. data/ext/nokogiri/xml_node_set.h +1 -1
  35. data/ext/nokogiri/xml_processing_instruction.c +4 -2
  36. data/ext/nokogiri/xml_reader.c +119 -47
  37. data/ext/nokogiri/xml_relax_ng.c +21 -12
  38. data/ext/nokogiri/xml_sax_parser.c +6 -3
  39. data/ext/nokogiri/xml_sax_parser.h +13 -17
  40. data/ext/nokogiri/xml_sax_parser_context.c +8 -6
  41. data/ext/nokogiri/xml_sax_push_parser.c +7 -6
  42. data/ext/nokogiri/xml_schema.c +62 -13
  43. data/ext/nokogiri/xml_syntax_error.c +18 -12
  44. data/ext/nokogiri/xml_syntax_error.h +1 -1
  45. data/ext/nokogiri/xml_text.c +4 -2
  46. data/ext/nokogiri/xml_xpath_context.c +60 -23
  47. data/ext/nokogiri/xslt_stylesheet.c +14 -3
  48. data/ext/nokogiri/zlib1.dll +0 -0
  49. data/lib/nokogiri.rb +17 -0
  50. data/lib/nokogiri/css/generated_parser.rb +72 -62
  51. data/lib/nokogiri/css/generated_tokenizer.rb +23 -24
  52. data/lib/nokogiri/css/parser.y +3 -1
  53. data/lib/nokogiri/css/tokenizer.rex +3 -3
  54. data/lib/nokogiri/css/xpath_visitor.rb +8 -3
  55. data/lib/nokogiri/ffi/html/sax/parser_context.rb +3 -3
  56. data/lib/nokogiri/ffi/libxml.rb +16 -2
  57. data/lib/nokogiri/ffi/structs/common_node.rb +15 -3
  58. data/lib/nokogiri/ffi/structs/xml_document.rb +13 -4
  59. data/lib/nokogiri/ffi/structs/xml_xpath_context.rb +3 -2
  60. data/lib/nokogiri/ffi/weak_bucket.rb +40 -0
  61. data/lib/nokogiri/ffi/xml/document.rb +27 -0
  62. data/lib/nokogiri/ffi/xml/entity_decl.rb +9 -0
  63. data/lib/nokogiri/ffi/xml/node.rb +142 -61
  64. data/lib/nokogiri/ffi/xml/node_set.rb +15 -12
  65. data/lib/nokogiri/ffi/xml/reader.rb +5 -0
  66. data/lib/nokogiri/ffi/xml/schema.rb +17 -0
  67. data/lib/nokogiri/ffi/xml/syntax_error.rb +4 -4
  68. data/lib/nokogiri/ffi/xml/xpath.rb +0 -10
  69. data/lib/nokogiri/ffi/xml/xpath_context.rb +22 -9
  70. data/lib/nokogiri/ffi/xslt/stylesheet.rb +3 -0
  71. data/lib/nokogiri/html/document.rb +5 -3
  72. data/lib/nokogiri/html/document_fragment.rb +28 -7
  73. data/lib/nokogiri/nokogiri.rb +1 -0
  74. data/lib/nokogiri/version.rb +6 -2
  75. data/lib/nokogiri/version_warning.rb +6 -3
  76. data/lib/nokogiri/xml.rb +1 -1
  77. data/lib/nokogiri/xml/builder.rb +35 -22
  78. data/lib/nokogiri/xml/document.rb +44 -12
  79. data/lib/nokogiri/xml/document_fragment.rb +16 -12
  80. data/lib/nokogiri/xml/entity_decl.rb +4 -0
  81. data/lib/nokogiri/xml/node.rb +152 -95
  82. data/lib/nokogiri/xml/node_set.rb +2 -1
  83. data/lib/nokogiri/xml/sax/push_parser.rb +1 -1
  84. data/lib/nokogiri/xml/schema.rb +1 -5
  85. data/lib/nokogiri/xml/syntax_error.rb +4 -0
  86. data/lib/nokogiri/xml/text.rb +9 -0
  87. data/lib/nokogiri/xml/xpath/syntax_error.rb +3 -0
  88. data/tasks/cross_compile.rb +157 -0
  89. data/tasks/test.rb +0 -6
  90. data/test/css/test_xpath_visitor.rb +9 -0
  91. data/test/helper.rb +49 -11
  92. data/test/html/sax/test_parser.rb +11 -1
  93. data/test/html/test_document.rb +8 -0
  94. data/test/html/test_document_fragment.rb +14 -2
  95. data/test/html/test_element_description.rb +5 -1
  96. data/test/html/test_node.rb +5 -66
  97. data/test/test_reader.rb +28 -0
  98. data/test/test_xslt_transforms.rb +14 -0
  99. data/test/xml/test_builder.rb +43 -0
  100. data/test/xml/test_cdata.rb +12 -0
  101. data/test/xml/test_document.rb +74 -39
  102. data/test/xml/test_document_fragment.rb +36 -0
  103. data/test/xml/test_entity_decl.rb +37 -0
  104. data/test/xml/test_node.rb +192 -65
  105. data/test/xml/test_node_reparenting.rb +253 -236
  106. data/test/xml/test_node_set.rb +67 -0
  107. data/test/xml/test_text.rb +8 -0
  108. data/test/xml/test_xpath.rb +32 -0
  109. metadata +119 -48
  110. data.tar.gz.sig +0 -0
  111. data/ext/nokogiri/iconv.dll +0 -0
  112. data/ext/nokogiri/xml_xpath.c +0 -53
  113. data/ext/nokogiri/xml_xpath.h +0 -11
  114. data/lib/nokogiri/xml/fragment_handler.rb +0 -79
  115. metadata.gz.sig +0 -0
@@ -1,11 +0,0 @@
1
- #ifndef NOKOGIRI_XML_XPATH
2
- #define NOKOGIRI_XML_XPATH
3
-
4
- #include <nokogiri.h>
5
-
6
- void init_xml_xpath();
7
- VALUE Nokogiri_wrap_xml_xpath(xmlXPathObjectPtr xpath);
8
-
9
- extern VALUE cNokogiriXmlXpath;
10
- #endif
11
-
@@ -1,79 +0,0 @@
1
- module Nokogiri
2
- module XML
3
- class FragmentHandler < Nokogiri::XML::SAX::Document # :nodoc:
4
- QNAME_REGEX = /(.*):(.*)/
5
-
6
- def initialize node, original_html
7
- @doc_started = false
8
- @document = node.document
9
- @stack = [node]
10
- @html_eh = node.kind_of? HTML::DocumentFragment
11
- @original_html = prepare_for_regex(original_html.strip)
12
- end
13
-
14
- def start_element name, attrs = []
15
- regex = @html_eh ? %r{^\s*<#{Regexp.escape(name)}}i :
16
- %r{^\s*<#{Regexp.escape(name)}}
17
-
18
- if ! @doc_started && @original_html =~ regex
19
- @doc_started = true
20
- end
21
- return unless @doc_started
22
-
23
- ns = nil
24
- if @document.root
25
- match = name.match(QNAME_REGEX)
26
- if match
27
- prefix, name = match[1], match[2]
28
- ns = @document.root.namespace_definitions.detect { |x|
29
- x.prefix == prefix
30
- }
31
- end
32
- end
33
-
34
- node = Element.new(name, @document)
35
- attrs << "" unless (attrs.length % 2) == 0
36
- Hash[*attrs].each do |k,v|
37
- node[k] = v
38
- end
39
-
40
- node.namespace = ns if ns
41
-
42
- @stack.last << node
43
- @stack << node
44
- end
45
-
46
- def characters string
47
- @doc_started = true
48
- @stack.last << Text.new(string, @document)
49
- end
50
-
51
- def comment string
52
- @stack.last << Comment.new(@document, string)
53
- end
54
-
55
- def cdata_block string
56
- @stack.last << CDATA.new(@document, string)
57
- end
58
-
59
- def end_element name
60
- return unless @stack.last.name == name
61
- @stack.pop
62
- end
63
-
64
- private
65
-
66
- #
67
- # the regexes used in start_element() and characters() anchor at
68
- # start-of-line, but we really only want them to anchor at
69
- # start-of-doc. so let's only save up to the first newline.
70
- #
71
- # this implementation choice was the result of some benchmarks, if
72
- # you're curious: http://gist.github.com/115936
73
- #
74
- def prepare_for_regex(string)
75
- (newline_index = string.index("\n")) ? string.slice(0,newline_index) : string
76
- end
77
- end
78
- end
79
- end
metadata.gz.sig DELETED
Binary file