Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: validating xml with perl

by tangent (Curate)
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 = ''; my $xml = ' +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
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 ''
      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?

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (9)
As of 2015-10-13 08:38 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (296 votes), past polls