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

Replies are listed 'Best First'.
Re^4: LibXML and parsing file with DTD
by AWallBuilder (Beadle) 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