Bugs: Browse | Submit New | Admin

[#28749] suppressempty is ignored by xml_out

Date:
2010-11-23 17:37
Priority:
3
Submitted By:
Bob Fitterman (fitterman)
Assigned To:
Nobody (None)
Category:
None
State:
Open
Summary:
suppressempty is ignored by xml_out

Detailed description
Even if you set the the option 'suppressempty' => true you will still receive this error when an empty value
is encountered:

ArgumentError (Use of uninitialized value!):
    /opt/local/lib/ruby/gems/1.8/gems/xml-simple-1.0.12/lib/xmlsimple.rb:799:in `value_to_xml'


In fact, the logic the error appears to be incorrect. I have changed this to something a little more direct and it is
working.

Original line 797:
  unless @options.has_key?('suppressempty') && @options['suppressempty'].nil?


Revised line 797:
  unless @options['suppressempty'] == true

Obviously this could be reduced to "unless @options['suppressempty']" but it's not clear to me what the legitimate
values are for the supressempty option.

Add A Comment: Notepad

Please login


Followup

No Followups Have Been Posted

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

No Changes Have Been Made to This Item