lib/xmlsimple.rb in xml-simple-1.1.7 vs lib/xmlsimple.rb in xml-simple-1.1.8
- old
+ new
@@ -9,11 +9,11 @@
# Easy API to maintain XML (especially configuration files).
class XmlSimple
include REXML
- @@VERSION = '1.1.7'
+ @@VERSION = '1.1.8'
# A simple cache for XML documents that were already transformed
# by xml_in.
class Cache
# Creates and initializes a new Cache object.
@@ -270,11 +270,11 @@
attrtosymbol attrprefix conversions kebabtosnakecase
),
'out' => %w(
keyattr keeproot contentkey noattr rootname
xmldeclaration outputfile noescape suppressempty
- anonymoustag indent grouptags noindent attrprefix
+ anonymoustag indent grouptags noindent attrprefix selfclose
)
}
# Define some reasonable defaults.
DEF_KEY_ATTRIBUTES = []
@@ -833,10 +833,10 @@
else
result << ' ' << ($1||key) << '="' << value << '"'
end
end
}
- else
+ elsif !@options['selfclose']
text_content = ''
end
if !nested.empty? || !text_content.nil?
if named