[Chicago-talk] XML::Simple MXLout SuppressEmpty
tiger peng
tigerpeng2001 at yahoo.com
Thu Sep 28 09:13:18 PDT 2006
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
More information about the Chicago-talk
mailing list