AW: [Xml-compile] Make sure not to block, like on loading external DTDs

Michael Ludwig m.ludwig at epages.com
Tue Feb 21 13:25:17 GMT 2012


> Von: Mark Overmeer
> * Michael Ludwig (m.ludwig at epages.com) [120221 10:43]:

> > Now I haven't debugged this, but under some circumstances
> > there's a long wait because something tries to get the HTML
> > DTD from the W3C website, and they have you wait deliberately
> > so you learn not to load the DTD from their site, and why
> > would you?
> 
> Ah, so when the answer is not XML and then you pretty_print
> the response body, you get this delay.  Maybe we should refuse
> pretty-printing anything else than xml...

That wouldn't help for the (admittedly) odd case where the service
returns an XML document including a DOCTYPE pointing you to a DTD.
Or simply supplies a wrong Content-Type in HTTP. Odd cases indeed,
but then, real life computing has lots of them.

> > my %opt = (load_ext_dtd => 0, recover => 1);
> >   no_network => 1
> > XML::LibXML->load_xml(location => shift, %opt)->toFH(*STDERR, 1);
> 
> patch applied twice.

Thanks. Best,

Michael



More information about the Xml-compile mailing list