nokogiri 1.5.0.beta.3 → 1.5.0.beta.4

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 (87) hide show
  1. data/CHANGELOG.ja.rdoc +32 -16
  2. data/CHANGELOG.rdoc +18 -0
  3. data/Manifest.txt +1 -2
  4. data/README.rdoc +27 -3
  5. data/Rakefile +39 -83
  6. data/ext/java/nokogiri/EncodingHandler.java +1 -1
  7. data/ext/java/nokogiri/HtmlDocument.java +11 -14
  8. data/ext/java/nokogiri/HtmlElementDescription.java +1 -1
  9. data/ext/java/nokogiri/HtmlEntityLookup.java +1 -1
  10. data/ext/java/nokogiri/HtmlSaxParserContext.java +13 -10
  11. data/ext/java/nokogiri/NokogiriService.java +103 -34
  12. data/ext/java/nokogiri/XmlAttr.java +14 -6
  13. data/ext/java/nokogiri/XmlAttributeDecl.java +1 -1
  14. data/ext/java/nokogiri/XmlCdata.java +3 -1
  15. data/ext/java/nokogiri/XmlComment.java +3 -1
  16. data/ext/java/nokogiri/XmlDocument.java +29 -8
  17. data/ext/java/nokogiri/XmlDocumentFragment.java +14 -13
  18. data/ext/java/nokogiri/XmlDtd.java +5 -2
  19. data/ext/java/nokogiri/XmlElement.java +2 -1
  20. data/ext/java/nokogiri/XmlElementContent.java +1 -1
  21. data/ext/java/nokogiri/XmlElementDecl.java +2 -1
  22. data/ext/java/nokogiri/XmlEntityDecl.java +2 -1
  23. data/ext/java/nokogiri/XmlEntityReference.java +1 -1
  24. data/ext/java/nokogiri/XmlNamespace.java +3 -2
  25. data/ext/java/nokogiri/XmlNode.java +17 -10
  26. data/ext/java/nokogiri/XmlNodeSet.java +40 -13
  27. data/ext/java/nokogiri/XmlProcessingInstruction.java +1 -1
  28. data/ext/java/nokogiri/XmlReader.java +3 -1
  29. data/ext/java/nokogiri/XmlRelaxng.java +37 -92
  30. data/ext/java/nokogiri/XmlSaxParserContext.java +25 -11
  31. data/ext/java/nokogiri/XmlSaxPushParser.java +6 -4
  32. data/ext/java/nokogiri/XmlSchema.java +190 -46
  33. data/ext/java/nokogiri/XmlSyntaxError.java +42 -37
  34. data/ext/java/nokogiri/XmlText.java +3 -2
  35. data/ext/java/nokogiri/XmlXpathContext.java +8 -4
  36. data/ext/java/nokogiri/XsltStylesheet.java +12 -10
  37. data/ext/java/nokogiri/internals/HtmlDomParserContext.java +8 -7
  38. data/ext/java/nokogiri/internals/NokogiriDocumentCache.java +1 -1
  39. data/ext/java/nokogiri/internals/NokogiriErrorHandler.java +11 -5
  40. data/ext/java/nokogiri/internals/NokogiriHandler.java +36 -9
  41. data/ext/java/nokogiri/internals/NokogiriHelpers.java +21 -22
  42. data/ext/java/nokogiri/internals/NokogiriNamespaceCache.java +5 -4
  43. data/ext/java/nokogiri/internals/NokogiriNamespaceContext.java +1 -1
  44. data/ext/java/nokogiri/internals/NokogiriNonStrictErrorHandler.java +2 -1
  45. data/ext/java/nokogiri/internals/NokogiriNonStrictErrorHandler4NekoHtml.java +1 -1
  46. data/ext/java/nokogiri/internals/NokogiriStrictErrorHandler.java +2 -1
  47. data/ext/java/nokogiri/internals/NokogiriXPathFunction.java +15 -9
  48. data/ext/java/nokogiri/internals/NokogiriXPathFunctionResolver.java +1 -1
  49. data/ext/java/nokogiri/internals/ParserContext.java +18 -7
  50. data/ext/java/nokogiri/internals/PushInputStream.java +1 -1
  51. data/ext/java/nokogiri/internals/ReaderNode.java +7 -6
  52. data/ext/java/nokogiri/internals/SaveContext.java +16 -10
  53. data/ext/java/nokogiri/internals/SchemaErrorHandler.java +13 -5
  54. data/ext/java/nokogiri/internals/XmlDeclHandler.java +1 -1
  55. data/ext/java/nokogiri/internals/XmlDomParser.java +1 -1
  56. data/ext/java/nokogiri/internals/XmlDomParserContext.java +13 -8
  57. data/ext/java/nokogiri/internals/XmlSaxParser.java +1 -1
  58. data/ext/java/nokogiri/internals/XsltExtensionFunction.java +1 -1
  59. data/ext/nokogiri/extconf.rb +3 -3
  60. data/ext/nokogiri/xml_document.c +9 -0
  61. data/ext/nokogiri/xml_sax_parser.c +4 -2
  62. data/lib/nokogiri.rb +9 -6
  63. data/lib/nokogiri/css.rb +1 -3
  64. data/lib/nokogiri/css/parser.rb +665 -70
  65. data/lib/nokogiri/css/parser.y +3 -1
  66. data/lib/nokogiri/css/parser_extras.rb +91 -0
  67. data/lib/nokogiri/css/tokenizer.rb +148 -3
  68. data/lib/nokogiri/css/tokenizer.rex +1 -1
  69. data/lib/nokogiri/html/document.rb +138 -11
  70. data/lib/nokogiri/html/sax/parser.rb +6 -2
  71. data/lib/nokogiri/version.rb +1 -1
  72. data/lib/nokogiri/xml/node.rb +2 -2
  73. data/lib/nokogiri/xml/node/save_options.rb +3 -0
  74. data/lib/nokogiri/xml/node_set.rb +1 -1
  75. data/test/css/test_tokenizer.rb +8 -0
  76. data/test/helper.rb +2 -0
  77. data/test/html/sax/test_parser.rb +43 -0
  78. data/test/html/test_document.rb +59 -0
  79. data/test/html/test_document_encoding.rb +48 -0
  80. data/test/html/test_element_description.rb +1 -1
  81. data/test/xml/sax/test_parser.rb +16 -0
  82. data/test/xml/test_document.rb +3 -1
  83. data/test/xml/test_node.rb +4 -1
  84. data/test/xml/test_node_set.rb +10 -0
  85. metadata +90 -107
  86. data/lib/nokogiri/css/generated_parser.rb +0 -676
  87. data/lib/nokogiri/css/generated_tokenizer.rb +0 -145
@@ -1,145 +0,0 @@
1
- #--
2
- # DO NOT MODIFY!!!!
3
- # This file is automatically generated by rex 1.0.4
4
- # from lexical definition file "lib/nokogiri/css/tokenizer.rex".
5
- #++
6
-
7
- module Nokogiri
8
- module CSS
9
- class GeneratedTokenizer < GeneratedParser
10
- require 'strscan'
11
-
12
- class ScanError < StandardError ; end
13
-
14
- attr_reader :lineno
15
- attr_reader :filename
16
- attr_accessor :state
17
-
18
- def scan_setup(str)
19
- @ss = StringScanner.new(str)
20
- @lineno = 1
21
- @state = nil
22
- end
23
-
24
- def action(&block)
25
- yield
26
- end
27
-
28
- def scan_str(str)
29
- scan_setup(str)
30
- do_parse
31
- end
32
-
33
- def load_file( filename )
34
- @filename = filename
35
- open(filename, "r") do |f|
36
- scan_setup(f.read)
37
- end
38
- end
39
-
40
- def scan_file( filename )
41
- load_file(filename)
42
- do_parse
43
- end
44
-
45
-
46
- def next_token
47
- return if @ss.eos?
48
-
49
- text = @ss.peek(1)
50
- @lineno += 1 if text == "\n"
51
- token = case @state
52
- when nil
53
- case
54
- when (text = @ss.scan(/has\([\s]*/))
55
- action { [:HAS, text] }
56
-
57
- when (text = @ss.scan(/[-@]?([_A-Za-z]|[^\0-\177]|\\[0-9A-Fa-f]{1,6}(\r\n|[\s])?|\\[^\n\r\f0-9A-Fa-f])([_A-Za-z0-9-]|[^\0-\177]|\\[0-9A-Fa-f]{1,6}(\r\n|[\s])?|\\[^\n\r\f0-9A-Fa-f])*\([\s]*/))
58
- action { [:FUNCTION, text] }
59
-
60
- when (text = @ss.scan(/[-@]?([_A-Za-z]|[^\0-\177]|\\[0-9A-Fa-f]{1,6}(\r\n|[\s])?|\\[^\n\r\f0-9A-Fa-f])([_A-Za-z0-9-]|[^\0-\177]|\\[0-9A-Fa-f]{1,6}(\r\n|[\s])?|\\[^\n\r\f0-9A-Fa-f])*/))
61
- action { [:IDENT, text] }
62
-
63
- when (text = @ss.scan(/\#([_A-Za-z0-9-]|[^\0-\177]|\\[0-9A-Fa-f]{1,6}(\r\n|[\s])?|\\[^\n\r\f0-9A-Fa-f])+/))
64
- action { [:HASH, text] }
65
-
66
- when (text = @ss.scan(/[\s]*~=[\s]*/))
67
- action { [:INCLUDES, text] }
68
-
69
- when (text = @ss.scan(/[\s]*\|=[\s]*/))
70
- action { [:DASHMATCH, text] }
71
-
72
- when (text = @ss.scan(/[\s]*\^=[\s]*/))
73
- action { [:PREFIXMATCH, text] }
74
-
75
- when (text = @ss.scan(/[\s]*\$=[\s]*/))
76
- action { [:SUFFIXMATCH, text] }
77
-
78
- when (text = @ss.scan(/[\s]*\*=[\s]*/))
79
- action { [:SUBSTRINGMATCH, text] }
80
-
81
- when (text = @ss.scan(/[\s]*!=[\s]*/))
82
- action { [:NOT_EQUAL, text] }
83
-
84
- when (text = @ss.scan(/[\s]*=[\s]*/))
85
- action { [:EQUAL, text] }
86
-
87
- when (text = @ss.scan(/[\s]*\)/))
88
- action { [:RPAREN, text] }
89
-
90
- when (text = @ss.scan(/[\s]*\[[\s]*/))
91
- action { [:LSQUARE, text] }
92
-
93
- when (text = @ss.scan(/[\s]*\]/))
94
- action { [:RSQUARE, text] }
95
-
96
- when (text = @ss.scan(/[\s]*\+[\s]*/))
97
- action { [:PLUS, text] }
98
-
99
- when (text = @ss.scan(/[\s]*>[\s]*/))
100
- action { [:GREATER, text] }
101
-
102
- when (text = @ss.scan(/[\s]*,[\s]*/))
103
- action { [:COMMA, text] }
104
-
105
- when (text = @ss.scan(/[\s]*~[\s]*/))
106
- action { [:TILDE, text] }
107
-
108
- when (text = @ss.scan(/\:not\([\s]*/))
109
- action { [:NOT, text] }
110
-
111
- when (text = @ss.scan(/-?([0-9]+|[0-9]*\.[0-9]+)/))
112
- action { [:NUMBER, text] }
113
-
114
- when (text = @ss.scan(/[\s]*\/\/[\s]*/))
115
- action { [:DOUBLESLASH, text] }
116
-
117
- when (text = @ss.scan(/[\s]*\/[\s]*/))
118
- action { [:SLASH, text] }
119
-
120
- when (text = @ss.scan(/U\+[0-9a-f?]{1,6}(-[0-9a-f]{1,6})?/))
121
- action {[:UNICODE_RANGE, text] }
122
-
123
- when (text = @ss.scan(/[\s]+/))
124
- action { [:S, text] }
125
-
126
- when (text = @ss.scan(/"([^\n\r\f"]|\n|\r\n|\r|\f|[^\0-\177]|\\[0-9A-Fa-f]{1,6}(\r\n|[\s])?|\\[^\n\r\f0-9A-Fa-f])*"|'([^\n\r\f']|\n|\r\n|\r|\f|[^\0-\177]|\\[0-9A-Fa-f]{1,6}(\r\n|[\s])?|\\[^\n\r\f0-9A-Fa-f])*'/))
127
- action { [:STRING, text] }
128
-
129
- when (text = @ss.scan(/./))
130
- action { [text, text] }
131
-
132
- else
133
- text = @ss.string[@ss.pos .. -1]
134
- raise ScanError, "can not match: '" + text + "'"
135
- end # if
136
-
137
- else
138
- raise ScanError, "undefined state: '" + state.to_s + "'"
139
- end # case state
140
- token
141
- end # def next_token
142
-
143
- end # class
144
- end
145
- end