DBIx-XML-DataLoader

 view release on metacpan or  search on metacpan

DataLoader.pm  view on Meta::CPAN



#############################################################################
## here we will check to make sure the files and directories requested
## exists
if(!$xml){warn "we had no xml sent in";return;}
if($xml =~ /^http:/){

my         $ua = new LWP::UserAgent;
         $ua->agent("DBIx_XML_DataLoader/1.0b " . $ua->agent);
my $req = new HTTP::Request(GET=>$xml);
my $res = $ua->request($req);
if ($res->is_success){
             $xml=$res->content;
         }
}

if($xml =~ /^http:/){die "we did not get the remote xml map file you requested";}



DataLoader/MapIt.pm  view on Meta::CPAN

my $xp;
{
no warnings;  # warnings are turned off because the XML::XPath 
	      #	generates warnings when we attempt to find node values


# added http requests for map files
if($filename =~ /http/){
my         $ua = new LWP::UserAgent;
         $ua->agent("DBIx::XML::DataLoader/1.0b " . $ua->agent);
my $req = new HTTP::Request(GET=>$filename);
my $res = $ua->request($req);

if ($res->is_success){
             $filename=$res->content;
         }
}
if($filename =~ /^http:/){die "we did not get the remote xml map file you requested";}

if($filename !~ /\</mg){$xp = XML::XPath->new(filename => $filename);}
if($filename =~ /\</mg){$xp = XML::XPath->new(xml => $filename);}



( run in 0.259 second using v1.01-cache-2.11-cpan-de7293f3b23 )