Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: validating xml with perl

by tangent (Priest)
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

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?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://960320]
help
Chatterbox?
[MidLifeXis]: Yeah, --notest is good, not sure I would do --force.
[thezip]: It fails 2/10 tests in that group. What are the ramifications if I force it? What should I look for for?
[thezip]: I've migrated from ActiveState to Strawberry. No going back...
[thezip]: I'll try the --notest arg first when I get back from meetings (after lunch).
[thezip]: Thanks guys for your comments! :-)
[1nickt]: Quick survey: has anyone used or even heard of autobox?
[Corion]: thezip: I would expect some (fancier?) numeric formatting to fail from these test failures
[1nickt]: ( Sometimes when idle I browse remote corners of the code repo at $work ... usually this yields knowledge of projects to decline and coworkers to avoid ... )
[LanX]: sure
[Corion]: 1nickt: Finding autobox in production would give me pause, yes

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (16)
As of 2017-03-23 17:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (291 votes). Check out past polls.