Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
We don't bite newbies here... much
 
PerlMonks  

Re^3: LibXML and parsing file with DTD

by derby (Monsignor)
on Jul 29, 2010 at 12:55 UTC ( #851934=note: print w/ replies, xml ) Need Help??


in reply to Re^2: LibXML and parsing file with DTD
in thread LibXML and parsing file with DTD

Hmmm ... what happens if you comment out the validate call?

-derby


Comment on Re^3: LibXML and parsing file with DTD
Re^4: LibXML and parsing file with DTD
by AWallBuilder (Sexton) on Jul 29, 2010 at 13:12 UTC

    Thanks! Once I commented out the validate call, it works

    I guess if the validate function doesn't like the xml files then it just dies?

      That's correct. I'm guessing either you cannot actually retrieve the dtd or you're getting some invalid cached copy of the dtd. If you really want to validate, you can load it from a file (rather then let libxml retrieve it via a network call) and then pass the string to the Dtd constructor:

      local $/ = undef; open my $fh, "<", $file || die "cannot open $file - $!\n"; my $str = <$fh>; close $fh; my $dtd = XML::LibXML::Dtd->parse_string( $str );

      -derby

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (18)
As of 2013-05-23 17:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best material for plates (tableware) is:









    Results (487 votes), past polls