#!/usr/bin/perl # dumpxml: Simply dumps an XML as a Perl structure use strict; use warnings; use XML::Simple; use Data::Dumper; if (!@ARGV or grep /^-h$/, @ARGV ) { print STDERR "Usage: dumpxml <XML FILE> [ '<XML::Simple options>' +]\n"; print STDERR "Example: dumpxml file.xml 'ForceArray => 1, KeyAttr +=> \"name\"'\n"; exit 0; } my $file = shift or die; my @options = eval "@ARGV"; my $xml = XMLin( $file, @options ); print Data::Dumper->Dump( [$xml], ["FILE{'$file'}"] );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Simple XML Dumper
by Anonymous Monk on Sep 30, 2008 at 11:12 UTC | |
by mscharrer (Hermit) on Sep 30, 2008 at 14:54 UTC | |
by moritz (Cardinal) on Sep 30, 2008 at 12:44 UTC | |
by jdporter (Paladin) on Sep 30, 2008 at 14:26 UTC | |
by moritz (Cardinal) on Sep 30, 2008 at 14:32 UTC |