/[webpac]/trunk/tests/test_xml_simple.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/tests/test_xml_simple.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 278 by dpavlin, Sun Mar 14 12:37:14 2004 UTC revision 279 by dpavlin, Sun Mar 14 14:59:43 2004 UTC
# Line 5  use XML::Simple; Line 5  use XML::Simple;
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    
# Line 13  if ($xml_file) { Line 22  if ($xml_file) {
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";

Legend:
Removed from v.278  
changed lines
  Added in v.279

  ViewVC Help
Powered by ViewVC 1.1.26