[EMAIL PROTECTED] wrote:
Hi,

I would like to suppress empty element when I output mu hash with
XMLout
but the option "suppressempty" only seeme to work with XMLin :
"suppressempty => 1 | '' | undef (in) : This option controls what
XMLin() should do [...]"

So, I've tried to undef element before call XMLOut :
        undef($xx->{"element"}[0]{"sub"}[0]);
        delete($xx->{"element"}[0]{"sub"}[0]);
        $xx->{"element"}[0]{"sub"}[0] = undef;

results : does'n work : I always have an output like this :
<xx>
  <element></element>
  <element>content of element</element>
</xx>

end I would like this :
<xx>
  <element>content of element</element>
</xx>

Could you help me to find a solution to undef element of my hash ?

I can't make sense of what is in your hash Paul. It doesn't correspond
to the XML you have shown, which would be generated from a structure
like

 my $xx = {
   element => [
     undef,
     'content of element',
   ],
 };

and if you try it you will see that that responds to the SuppressEmpty
option correctly.

Show us your actual data and we will be able to help.

Rob

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to