#!/usr/bin/perl use strict; use warnings; use XML::Simple; use Data::Dumper; use Data::Dump 'pp'; #my $content = $response->decoded_content(); my $content = qq|<?xml version=\'1.0\' encoding=\'UTF-8\'?><soap:Envel +ope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Header><ais:requestID xmlns:ais="http://com"> {7f000001-47db2420000001569783cdb88136} </ais:requestID> </soap:Header> <soap:Body> <soap:Fault> <faultcode>soap:Server</faultcode> <faultstring> check expression: </faultstring> <faultactor>CheckTwo</faultactor> <detail> <longDescription xmlns="http://com"> Exception occurred </longDescription> <MaxCode xmlns="http://com/Server">-2225</MaxCode> </detail> </soap:Fault> </soap:Body> </soap:Envelope>|; #my $parser = new XML::Simple; my $parser= XML::Simple->new( KeepRoot => 1, KeyAttr => [], ForceArray + => [qw( MaxCode )] ); my $data = $parser->XMLin($content); my $result = $data->{'soap:Body'}->{'soap:Fault'}->{'detail'}->{'MaxCo +de'};
In reply to Re^2: Parsing with XML::Simple
by Anonymous Monk
in thread Parsing with XML::Simple
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |