Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use strict;
- use warnings;
- use Data::Dumper qw( Dumper );
- use XML::SAX qw( );
- use XML::Simple qw( XMLin );
- #$XML::Simple::PREFERRED_PARSER = "XML::Parser";
- $XML::Simple::PREFERRED_PARSER = "XML::SAX::Expat";
- print(Dumper(XMLin(\*DATA, NSExpand => 1)));
- __DATA__
- <doc xmlns:xyz="http://a" xmlns:ec="http://b">
- <xyz:CostFee>
- <ec:OPA>25.00</ec:OPA>
- <ec:CTID>278421</ec:CTID>
- <xyz:CDEPSID>82</xyz:CDEPSID>
- <ec:IID>8765654</ec:IID>
- </xyz:CostFee>
- </doc>
- __END__
- $VAR1 = {
- '{http://a}CostFee' => {
- '{http://a}CDEPSID' => '82',
- '{http://b}CTID' => '278421',
- '{http://b}IID' => '8765654',
- '{http://b}OPA' => '25.00'
- },
- '{http://www.w3.org/2000/xmlns/}xyz' => 'http://a',
- '{http://www.w3.org/2000/xmlns/}ec' => 'http://b'
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement