xml-simple 1.0.9 → 1.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/xmlsimple.rb +5 -6
  2. metadata +2 -2
data/lib/xmlsimple.rb CHANGED
@@ -928,16 +928,15 @@ class XmlSimple
928
928
  # default::
929
929
  # Value to be returned, if node could not be converted.
930
930
  def node_to_text(node, default = nil)
931
- result = if node.instance_of?(Element)
932
- node.texts.join('')
933
- elsif node.instance_of?(Attribute)
931
+ if node.instance_of?(REXML::Element)
932
+ node.texts.map { |t| t.value }.join('')
933
+ elsif node.instance_of?(REXML::Attribute)
934
934
  node.value.nil? ? default : node.value.strip
935
- elsif node.instance_of?(Text)
936
- node.to_s.strip
935
+ elsif node.instance_of?(REXML::Text)
936
+ node.value.strip
937
937
  else
938
938
  default
939
939
  end
940
- Text::unnormalize(result)
941
940
  end
942
941
 
943
942
  # Parses an XML string and returns the according document.
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
3
3
  specification_version: 1
4
4
  name: xml-simple
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.0.9
7
- date: 2006-07-02 00:00:00 +02:00
6
+ version: 1.0.10
7
+ date: 2006-10-26 00:00:00 +02:00
8
8
  summary: A very simple API for XML processing.
9
9
  require_paths:
10
10
  - lib