xml-simple 1.0.14 → 1.0.15
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/xmlsimple.rb +8 -5
- metadata +3 -3
data/lib/xmlsimple.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# = XmlSimple
|
2
2
|
#
|
3
3
|
# Author:: Maik Schmidt <contact@maik-schmidt.de>
|
4
|
-
# Copyright:: Copyright (c) 2003-
|
4
|
+
# Copyright:: Copyright (c) 2003-2011 Maik Schmidt
|
5
5
|
# License:: Distributes under the same terms as Ruby.
|
6
6
|
#
|
7
7
|
require 'rexml/document'
|
@@ -11,7 +11,7 @@ require 'stringio'
|
|
11
11
|
class XmlSimple
|
12
12
|
include REXML
|
13
13
|
|
14
|
-
@@VERSION = '1.0.
|
14
|
+
@@VERSION = '1.0.15'
|
15
15
|
|
16
16
|
# A simple cache for XML documents that were already transformed
|
17
17
|
# by xml_in.
|
@@ -800,9 +800,12 @@ class XmlSimple
|
|
800
800
|
end
|
801
801
|
|
802
802
|
# Check for the '@' attribute prefix to allow separation of attributes and elements
|
803
|
-
|
804
|
-
|
805
|
-
|
803
|
+
|
804
|
+
if (@options['noattr'] ||
|
805
|
+
(@options['attrprefix'] && !(key =~ /^@(.*)/)) ||
|
806
|
+
!scalar(value)
|
807
|
+
) &&
|
808
|
+
key != @options['contentkey']
|
806
809
|
nested << value_to_xml(value, key, indent + @options['indent'])
|
807
810
|
else
|
808
811
|
value = value.to_s
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 1.0.
|
8
|
+
- 15
|
9
|
+
version: 1.0.15
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Maik Schmidt
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-
|
17
|
+
date: 2011-03-24 00:00:00 +01:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|