kulls has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use strict; use warnings; use Data::Dumper; use XML::SAX::Simple qw( XMLin); open (FH, "> test.xml") || die ("Could not create the file. $!"); print FH <<EOF; <?xml version="1.0"?> <txworld:data xmlns:txworld="www.toxinworld.com/xmlns"> <txworld:test name="name" version="1"> <txworld:general>100</txworld:general> </txworld:test> </txworld:data> EOF close (FH); my $hash=XMLin('test.xml'); print STDERR Dumper($hash); unlink("test.xml"); exit; =item --WITH_ATTRIBUT_OUTPUT-- $VAR1 = { 'xmlns:txworld' => 'www.toxinworld.com/xmlns', 'txworld:test' => { 'parent' => 'parent', 'version' => '1', 'name' => 'name', 'txworld:general' => { 'content' => '100', 'type' => '1' }, 'type' => 'type', 'alias' => 'alias' } }; --WITHOUT_ATTRIBUT_OUTPUT-- $VAR1 = { 'xmlns:txworld' => 'www.toxinworld.com/xmlns', 'txworld:test' => { 'parent' => 'parent', 'version' => '1', 'name' => 'name', 'txworld:general' => '100', 'type' => 'type', 'alias' => 'alias' } }; =cut
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: XML::SAX::Simple module
by Devanchya (Beadle) on Dec 10, 2006 at 14:43 UTC | |
|
Re: XML::SAX::Simple module
by Anonymous Monk on Dec 10, 2006 at 09:44 UTC | |
|
Re: XML::SAX::Simple module
by Errto (Vicar) on Dec 11, 2006 at 05:31 UTC |