Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

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 = ''; 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 imbibing at the Monastery: (6)
As of 2015-11-26 23:51 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (710 votes), past polls