Michael Ludwig schrieb am 06.03.2011 um 12:43 (+0100):

> my $dtdchunk = read_file $dtdfile;
> my $parser = XML::LibXML->new;
> 
> foreach ( @xmlfiles ) {
>         my $xmlchunk = read_file $_;
>         $parser->parse_chunk( $dtdchunk );
>         my $doc = $parser->parse_chunk( $xmlchunk, 1 );
>         print $doc->toString, "\n\n";
> }

There are problems with this approach, of course.

You have to know or detect the encoding of each chunk you want to parse.

You have to make sure there is no XML declaration on any chunk that is
not right at the start of the document.

-- 
Michael Ludwig
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
[email protected]
http://mail.gnome.org/mailman/listinfo/xml

Reply via email to