/[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

Contents of /trunk/tests/test_xml_simple.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 278 - (show annotations)
Sun Mar 14 12:37:14 2004 UTC (15 years, 10 months ago) by dpavlin
File MIME type: text/plain
File size: 392 byte(s)
moved tests in own directory, added test to demonstrate XML::Simple feature
to remove spaces from begin and end attribute value (which is wrong for
delimiters as WebPAC uses them)

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"?><xml foo="a" foo_a=" a" foo_a_=" a " fooa_="a ">truæ</xml>';
9
10 my $xml_file = shift @ARGV;
11
12 if ($xml_file) {
13 my $fh = new IO::File($xml_file) || die "can't open $xml_file: $!";
14 $xml = XMLin($fh);
15 } else {
16 $xml = XMLin($xml);
17 }
18
19 print Dumper($xml),"\n";
20

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26