[Chicago-talk] XML::Simple MXLout SuppressEmpty

Kent Cowgill kent at c2group.net
Thu Sep 28 09:18:45 PDT 2006


It's his PGP signature.

-Kent Cowgill

C2 Group, Inc.                                             
kent at c2group.net
http://www.c2group.net                                         
312.804.0160


On Sep 28, 2006, at 11:13 AM, tiger peng wrote:

> Then, I need an eraser :-).
> What is the attachment 'file.bin'? I'd better erase
> it.
>
>
> --- "Michael D. Stemle, Jr."
> <manchicken at notsosoft.net> wrote:
>
>> You may have to just weed it out manually...  I've
>> never figured out how to
>> get that to work...
>>
>> On Wednesday 27 September 2006 14:59, tiger peng
>> wrote:
>>> Hello all,
>>>
>>> Is there simple way to avoid an empty hash being
>> shown
>>> up as an empty element in XML with XML::Simple?
>>> According to perldoc XML::Simple, the
>> SuppressEmpty
>>> only work for undef in XMLout.
>>>
>>> print Dumper($tree);
>>> print XMLout($tree, SuppressEmpty => 1);
>>>
>>> $VAR1 = {
>>>   'category' => {
>>>     '301994' => {
>>>       'level' => 2,
>>>       'categroy' => {},
>>>       'name' => Furniture',
>>>       'code' => '301994'
>>>       }
>>>     }
>>> };
>>> <opt>
>>>   <category name="Furniture" code="301994"
>> level="2">
>>>     <categroy></categroy>
>>>   </category>
>>> </opt>
>>>
>>> #Here is my ugly work-around:
>>>  print XMLout(XMLin(XMLout($tree), SuppressEmpty
>> =>
>>> 1));
>>> <opt>
>>>   <category name="Furniture" code="301994"
>> level="2"
>>> />
>>> </opt>
>>>
>>> _______________________________________________
>>> Chicago-talk mailing list
>>> Chicago-talk at pm.org
>>> http://mail.pm.org/mailman/listinfo/chicago-talk
>>
>> -- 
>> ~ Michael D. Stemle, Jr. <><
>> (A)bort, (R)etry, (I)nfluence with large hammer
>>> _______________________________________________
>> Chicago-talk mailing list
>> Chicago-talk at pm.org
>> http://mail.pm.org/mailman/listinfo/chicago-talk
>
> _______________________________________________
> Chicago-talk mailing list
> Chicago-talk at pm.org
> http://mail.pm.org/mailman/listinfo/chicago-talk
>



More information about the Chicago-talk mailing list