1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
use strict;
use Test::More;
use XML::Struct qw(readXML);
my $xml = <<XML;
<journal-meta>
<journal type="nlm-ta">BMC Womens Health 1</journal>
<journal type="iso-abbrev">BMC Womens Health 2</journal>
</journal-meta>
XML
my $simple = readXML($xml, simple => 1);
is_deeply $simple, { journal => [
{ type => 'nlm-ta', content => 'BMC Womens Health 1' },
{ type => 'iso-abbrev', content => 'BMC Womens Health 2' }
] }, 'include content for simple XML';
$simple = readXML($xml, simple => 1, content => 'name' );
is_deeply $simple, { journal => [
{ type => 'nlm-ta', name => 'BMC Womens Health 1' },
{ type => 'iso-abbrev', name => 'BMC Womens Health 2' }
] }, 'include content for simple XML';
done_testing;
|