xml-simple 1.0.9 → 1.0.10
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/xmlsimple.rb +5 -6
- 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
|
-
|
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.
|
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.
|
7
|
-
date: 2006-
|
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
|