/[webpac]/trunk2/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

Contents of /trunk2/tests/test_xml_simple.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 337 - (show annotations)
Thu Jun 10 19:22:40 2004 UTC (19 years, 9 months ago) by dpavlin
File MIME type: text/plain
File size: 628 byte(s)
new trunk for webpac v2

1 #!/usr/bin/perl -w
2
3 use strict;
4 use XML::Simple;
5 use IO::File;
6 use Data::Dumper;
7
8 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;
20
21 if ($xml_file) {
22 my $fh = new IO::File($xml_file) || die "can't open $xml_file: $!";
23 $xml = XMLin($fh);
24 } else {
25 $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";
34

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26