rexml 3.2.5 → 3.3.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rexml might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/NEWS.md +204 -2
- data/README.md +10 -1
- data/doc/rexml/tasks/rdoc/element.rdoc +2 -2
- data/doc/rexml/tutorial.rdoc +1358 -0
- data/lib/rexml/attribute.rb +14 -9
- data/lib/rexml/document.rb +1 -1
- data/lib/rexml/element.rb +3 -3
- data/lib/rexml/entity.rb +25 -15
- data/lib/rexml/formatters/pretty.rb +2 -2
- data/lib/rexml/functions.rb +1 -2
- data/lib/rexml/namespace.rb +8 -4
- data/lib/rexml/node.rb +8 -4
- data/lib/rexml/parseexception.rb +1 -0
- data/lib/rexml/parsers/baseparser.rb +247 -229
- data/lib/rexml/parsers/xpathparser.rb +136 -86
- data/lib/rexml/rexml.rb +3 -1
- data/lib/rexml/source.rb +114 -100
- data/lib/rexml/text.rb +6 -4
- data/lib/rexml/xpath_parser.rb +7 -3
- metadata +12 -38
data/lib/rexml/xpath_parser.rb
CHANGED
@@ -590,6 +590,7 @@ module REXML
|
|
590
590
|
|
591
591
|
def evaluate_predicate(expression, nodesets)
|
592
592
|
enter(:predicate, expression, nodesets) if @debug
|
593
|
+
new_nodeset_count = 0
|
593
594
|
new_nodesets = nodesets.collect do |nodeset|
|
594
595
|
new_nodeset = []
|
595
596
|
subcontext = { :size => nodeset.size }
|
@@ -606,17 +607,20 @@ module REXML
|
|
606
607
|
result = result[0] if result.kind_of? Array and result.length == 1
|
607
608
|
if result.kind_of? Numeric
|
608
609
|
if result == node.position
|
609
|
-
|
610
|
+
new_nodeset_count += 1
|
611
|
+
new_nodeset << XPathNode.new(node, position: new_nodeset_count)
|
610
612
|
end
|
611
613
|
elsif result.instance_of? Array
|
612
614
|
if result.size > 0 and result.inject(false) {|k,s| s or k}
|
613
615
|
if result.size > 0
|
614
|
-
|
616
|
+
new_nodeset_count += 1
|
617
|
+
new_nodeset << XPathNode.new(node, position: new_nodeset_count)
|
615
618
|
end
|
616
619
|
end
|
617
620
|
else
|
618
621
|
if result
|
619
|
-
|
622
|
+
new_nodeset_count += 1
|
623
|
+
new_nodeset << XPathNode.new(node, position: new_nodeset_count)
|
620
624
|
end
|
621
625
|
end
|
622
626
|
end
|
metadata
CHANGED
@@ -1,51 +1,23 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rexml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kouhei Sutou
|
8
|
-
autorequire:
|
9
|
-
bindir:
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-06-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: strscan
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
|
-
type: :
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rake
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: test-unit
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
|
-
type: :development
|
20
|
+
type: :runtime
|
49
21
|
prerelease: false
|
50
22
|
version_requirements: !ruby/object:Gem::Requirement
|
51
23
|
requirements:
|
@@ -73,6 +45,7 @@ extra_rdoc_files:
|
|
73
45
|
- doc/rexml/tasks/tocs/master_toc.rdoc
|
74
46
|
- doc/rexml/tasks/tocs/node_toc.rdoc
|
75
47
|
- doc/rexml/tasks/tocs/parent_toc.rdoc
|
48
|
+
- doc/rexml/tutorial.rdoc
|
76
49
|
files:
|
77
50
|
- LICENSE.txt
|
78
51
|
- NEWS.md
|
@@ -89,6 +62,7 @@ files:
|
|
89
62
|
- doc/rexml/tasks/tocs/master_toc.rdoc
|
90
63
|
- doc/rexml/tasks/tocs/node_toc.rdoc
|
91
64
|
- doc/rexml/tasks/tocs/parent_toc.rdoc
|
65
|
+
- doc/rexml/tutorial.rdoc
|
92
66
|
- lib/rexml.rb
|
93
67
|
- lib/rexml/attlistdecl.rb
|
94
68
|
- lib/rexml/attribute.rb
|
@@ -143,7 +117,7 @@ homepage: https://github.com/ruby/rexml
|
|
143
117
|
licenses:
|
144
118
|
- BSD-2-Clause
|
145
119
|
metadata: {}
|
146
|
-
post_install_message:
|
120
|
+
post_install_message:
|
147
121
|
rdoc_options:
|
148
122
|
- "--main"
|
149
123
|
- README.md
|
@@ -153,15 +127,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
153
127
|
requirements:
|
154
128
|
- - ">="
|
155
129
|
- !ruby/object:Gem::Version
|
156
|
-
version:
|
130
|
+
version: 2.5.0
|
157
131
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
158
132
|
requirements:
|
159
133
|
- - ">="
|
160
134
|
- !ruby/object:Gem::Version
|
161
135
|
version: '0'
|
162
136
|
requirements: []
|
163
|
-
rubygems_version: 3.
|
164
|
-
signing_key:
|
137
|
+
rubygems_version: 3.4.20
|
138
|
+
signing_key:
|
165
139
|
specification_version: 4
|
166
140
|
summary: An XML toolkit for Ruby
|
167
141
|
test_files: []
|