rexle 0.9.43 → 0.9.44

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/rexle.rb +8 -2
  2. metadata +2 -2
@@ -10,6 +10,8 @@ require 'cgi'
10
10
  include REXML
11
11
 
12
12
  # modifications:
13
+ # 16-Aug-2012: the current element's text (if its not empty) is now returned
14
+ # from its children method
13
15
  # 15-Aug-2012: feature: xpath containing child:: now supported
14
16
  # 13-Aug-2012: bug fix: xpath can now handle the name() function
15
17
  # 11-Aug-2012: bug fix: separated the max() method from 1 line into 3
@@ -405,7 +407,11 @@ class Rexle
405
407
  end
406
408
 
407
409
  def attributes() @attributes end
408
- def children() @child_elements end
410
+
411
+ def children()
412
+ (@value.empty? ? [] : [@value]) + @child_elements
413
+ end
414
+
409
415
  def children=(a) @child_elements = a end
410
416
  def deep_clone() Rexle.new(self.xml).root end
411
417
  def clone() Element.new(@name, @value, @attributes) end
@@ -713,7 +719,7 @@ class Rexle
713
719
  def scan_element(name, value=nil, attributes=nil, *children)
714
720
 
715
721
  element = Element.new(name, value, attributes, self)
716
-
722
+ puts 'children : ' + children.inspect
717
723
  if children then
718
724
  children.each do |x|
719
725
  if x.is_a? Array 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.43
5
+ version: 0.9.44
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: 2012-08-15 00:00:00 Z
13
+ date: 2012-08-16 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rexleparser