in reply to Re^2: Best XML library to validate XML from untrusted source
in thread Best XML library to validate XML from untrusted source

I have no idea why you wouldn't recommend

use XML::LibXML::Reader qw( ); my $reader = XML::LibXML::Reader->new( location => $file_or_url, load_ext_dtd => 0, expand_entities => 0, ); 1 while $reader->read;

Wrapping this up just so you get something you can call higher-level simply is pure waste.

Replies are listed 'Best First'.
Re^4: Best XML library to validate XML from untrusted source
by Jenda (Abbot) on Oct 20, 2014 at 20:15 UTC

    Say, because it doesn't do anything? I mean, yes, it does some kind of basic format validation, but once you actually need to extract some data out of the file, things start getting complicated very quickly.

    Jenda
    Enoch was right!
    Enjoy the last years of Rome.

      Nothing? What are you talking about? It validates the file as the OP requested.

      ...Actually, that's now what he requested. He requested

      use XML::LibXML::Reader qw( XML_READER_TYPE_ENTITY_REFERENCE ); my $reader = XML::LibXML::Reader->new( location => $file_or_url, load_ext_dtd => 0, expand_entities => 0, ); while ($reader->read) { die if $reader->nodeType == XML_READER_TYPE_ENTITY_REFERENCE; }

      What exactly is the problem???