rexle 0.9.7 → 0.9.8
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rexle.rb +5 -9
- metadata +2 -2
data/lib/rexle.rb
CHANGED
@@ -29,7 +29,7 @@ module XMLhelper
|
|
29
29
|
def scan_print(nodes)
|
30
30
|
|
31
31
|
nodes.map do |x|
|
32
|
-
|
32
|
+
|
33
33
|
if x.is_a? Rexle::Element then
|
34
34
|
unless x.name == '![' then
|
35
35
|
a = x.attributes.to_a.map{|k,v| "%s='%s'" % [k,v]}
|
@@ -165,7 +165,6 @@ class Rexle
|
|
165
165
|
#remove any prefixes
|
166
166
|
#@rexle.prefixes.each {|x| xpath_value.sub!(x + ':','') }
|
167
167
|
|
168
|
-
puts 'xpath_value : ' + xpath_value.inspect
|
169
168
|
xpath_value.sub!(/^\[/,'*[')
|
170
169
|
#xpath_value.sub!(/^attribute::/,'*/attribute::')
|
171
170
|
raw_path, raw_condition = xpath_value.sub(/^\/(?!\/)/,'').match(/([^\[]+)(\[[^\]]+\])?/).captures
|
@@ -181,8 +180,7 @@ class Rexle
|
|
181
180
|
return @value
|
182
181
|
else
|
183
182
|
attribute = xpath_value[/^(attribute::|@)(.*)/,2]
|
184
|
-
|
185
|
-
puts '@attributes ; ' + @attributes.inspect
|
183
|
+
|
186
184
|
return [@attributes[attribute.to_sym]] if attribute and @attributes and @attributes.has_key?(attribute.to_sym)
|
187
185
|
|
188
186
|
s = a_path.shift
|
@@ -207,12 +205,10 @@ class Rexle
|
|
207
205
|
|
208
206
|
attr_search = format_condition(condition) if condition and condition.length > 0
|
209
207
|
|
210
|
-
puts 'attr_search : ' + attr_search.inspect
|
211
|
-
|
212
208
|
if raw_path[0,2] == '//'
|
213
209
|
return scan_match(self, xpath_value)
|
214
210
|
else
|
215
|
-
|
211
|
+
|
216
212
|
return_elements = @child_lookup.map.with_index.select do |x|
|
217
213
|
x[0][0] == element_name or element_name == '*'
|
218
214
|
end
|
@@ -433,7 +429,7 @@ class Rexle
|
|
433
429
|
|
434
430
|
r = node.xpath(xpath[2..-1])
|
435
431
|
r << node.children.map {|n| scan_match(n, xpath)}
|
436
|
-
|
432
|
+
|
437
433
|
r
|
438
434
|
end
|
439
435
|
|
@@ -554,7 +550,7 @@ class Rexle
|
|
554
550
|
end
|
555
551
|
|
556
552
|
def scan_element(name, value=nil, attributes=nil, *children)
|
557
|
-
|
553
|
+
|
558
554
|
element = Element.new(name, value, attributes, self)
|
559
555
|
|
560
556
|
if children then
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: rexle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.9.
|
5
|
+
version: 0.9.8
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- James Robertson
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-07-
|
13
|
+
date: 2011-07-25 00:00:00 +01:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|