diff options
Diffstat (limited to 'lib/rexml/element.rb')
-rw-r--r-- | lib/rexml/element.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/rexml/element.rb b/lib/rexml/element.rb index 27886a90bc..25e530de41 100644 --- a/lib/rexml/element.rb +++ b/lib/rexml/element.rb @@ -74,10 +74,9 @@ module REXML rv << " " attr.write( rv, 0 ) end - rv << ">" if children.size > 0 - rv << " ... </>" + rv << "> ... </>" else rv << "/>" end @@ -976,6 +975,10 @@ module REXML return nil end + def to_a + values.flatten + end + # Returns the number of attributes the owning Element contains. # doc = Document "<a x='1' y='2' foo:x='3'/>" # doc.root.attributes.length #-> 3 |