I was able to get XML::Simple to read in that data just fine. However, I did notice that your opening "declaration" tag was missing the ">" at the end of that line. Not sure if that is missing in your original data or if this was a just a "cut & paste" mistake in your post.
Here's the contents of sample.xml:
<declaration dd:maxOccur="-1" dd:minOccur="0" dd:nullType="exclude"> <contentDeclaration dd:minOccur="0" dd:nullType="exclude"/> <value dd:minOccur="0" dd:nullType="exclude"/> </declaration>
Here's the code I ran:
use strict; use warnings; use XML::Simple; use Data::Dumper; my $xml = XMLin('sample.xml'); print Dumper($xml);
And here's the output:
$VAR1 = { 'dd:minOccur' => '0', 'contentDeclaration' => { 'dd:minOccur' => '0', 'dd:nullType' => 'exclude' }, 'value' => { 'dd:minOccur' => '0', 'dd:nullType' => 'exclude' }, 'dd:maxOccur' => '-1', 'dd:nullType' => 'exclude' };
In reply to Re: XML::Simple problems
by dasgar
in thread XML::Simple problems
by norricorp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |