Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
Syntactic Confectionery Delight
 
PerlMonks  

Re: validating xml with perl

by tangent (Chaplain)
on Mar 18, 2012 at 20:38 UTC ( #960320=note: print w/ replies, xml ) Need Help??


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


Comment on Re: validating xml with perl
Download Code
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?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://960320]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (10)
As of 2014-04-16 12:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (425 votes), past polls