I'm struggling with XML::Simple in Perl and nullable Elements.
So this is my example-XML:
<MyXml>
<SomeNumber>123</SomeNumber>
<EmptyOne/>
<NullableElement xsi:nil="true"></NullableElement>
</MyXml>
If I read this with XMLin and SuppressEmpty => 1 I'll get an empty string for the EmptyOne, but a Hash with xsi:nil="true" for the NullableElement. My questions is, how can I tell the XMLin to ignore the xsi:nil-Content and just give me an empty string or undef? Is this even possible with XML::Simple or should I switch to Lib::XML?
Here some code to see the result:
use XML::Simple;
use Data::Dumper;
my $xmlIn = '<MyXml><SomeNumber>123</SomeNumber><EmptyOne/><NullableElement xsi:nil="true"></NullableElement></MyXml>';
my $xmlHash = XMLin($xmlIn, SuppressEmpty => '');
print Dumper($xmlHash);