A
anthony
Hello.
I have written some perl code that works fine for a particular XML file
that is parses and converts to CSV format.
my $struct = $simple->XMLin($xmlcontent, forcearray => 1, keeproot =>
1, noattr => 1 );
the above line is what I use to read the elements and extract the data
attached to them.
It works fine when the elements all contain data. However, now I have a
new XML file that I need to parse and one of the elements in most cases
does not contain any data. <element></element>
In my csv output, if the element is empty I get the entry
"HASH(0x20b32200)" appearing.
Can anyone help me on how I can ignore the elements that are empty and
not write anything to the output file?
Thanks
I have written some perl code that works fine for a particular XML file
that is parses and converts to CSV format.
my $struct = $simple->XMLin($xmlcontent, forcearray => 1, keeproot =>
1, noattr => 1 );
the above line is what I use to read the elements and extract the data
attached to them.
It works fine when the elements all contain data. However, now I have a
new XML file that I need to parse and one of the elements in most cases
does not contain any data. <element></element>
In my csv output, if the element is empty I get the entry
"HASH(0x20b32200)" appearing.
Can anyone help me on how I can ignore the elements that are empty and
not write anything to the output file?
Thanks