in reply to validating xml with perl

Can you post the full error message. I tried the code below and got no errors.
use XML::LibXML; my $xsd = 'http://nvd.nist.gov/schema/nvd-cve-feed_2.0.xsd'; my $xml = 'http://static.nvd.nist.gov/feeds/xml/cve/nvdcve-2.0-recent. +xml'; my $schema = XML::LibXML::Schema->new(location =>$xsd); my $parser = XML::LibXML->new; my $doc = $parser->parse_file($xml); eval { $schema->validate( $doc ) }; if ( my $ex = $@ ) { print $ex; } else { print "Schema validated ok"; } # OUTPUT Schema validated ok

Replies are listed 'Best First'.
Re^2: validating xml with perl
by Johnd (Initiate) on Mar 18, 2012 at 21:30 UTC
    here is the error message i get: Schemas parser error : Failed to locate the main schema resource at 'http://nvd.nist.gov/schema/nvd-cve-feed_2.0.xsd'
      It seems like you're not even getting as far as retrieving the xsd file from the remote server. Can you normally retrieve files over the internet using Perl?