5 |
use IO::File; |
use IO::File; |
6 |
use Data::Dumper; |
use Data::Dumper; |
7 |
|
|
8 |
my $xml = '<?xml version="1.0" encoding="ISO-8859-2"?><xml foo="a" foo_a=" a" foo_a_=" a " fooa_="a ">truæ</xml>'; |
my $xml = '<?xml version="1.0" encoding="ISO-8859-2"?> |
9 |
|
<xml> |
10 |
|
<isis delimiter=" aa ">foo</isis> |
11 |
|
<isis> |
12 |
|
<delimiter> aa </delimiter> |
13 |
|
<format>foo</format> |
14 |
|
</isis> |
15 |
|
|
16 |
|
<test foo="a" foo_a=" a" foo_a_=" a " fooa_="a ">truæ</test> |
17 |
|
</xml>'; |
18 |
|
|
19 |
my $xml_file = shift @ARGV; |
my $xml_file = shift @ARGV; |
20 |
|
|
22 |
my $fh = new IO::File($xml_file) || die "can't open $xml_file: $!"; |
my $fh = new IO::File($xml_file) || die "can't open $xml_file: $!"; |
23 |
$xml = XMLin($fh); |
$xml = XMLin($fh); |
24 |
} else { |
} else { |
25 |
$xml = XMLin($xml); |
$xml = XMLin($xml, |
26 |
|
ForceArray => [ 'isis', 'config', 'format' ], |
27 |
|
ForceContent => 1, |
28 |
|
NormaliseSpace => 0, |
29 |
|
KeyAttr => [ 'isis' ] |
30 |
|
); |
31 |
} |
} |
32 |
|
|
33 |
print Dumper($xml),"\n"; |
print Dumper($xml),"\n"; |