Re: libxml: is it possible not to use doctype declaration?



hi Phlip,

thanks for the suggestion. The document is not an HTML document. It is
an XML document. It is something like this:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE test PUBLIC "-//FARAWAY//DTD-verweg//NL"
"http://some.site.nl/dtd/test.dtd";>
<test>
<p>this is a test</p>
</test>

I don't want XML::Document to resolve the URL and waiting for a
timeout. I couldn't find anything in the documentation on this.

regards, Ruud



On 29/07/2008, Phlip <phlip2005@xxxxxxxxx> wrote:
ruud grosmann wrote:

This works fine, but not if the document contains a doctype
declaration with a system identifier. For some reason, libxml tries to
resolve it. Leading to significant performances issues.

If the doctype is an HTML, open the document like this:

xp = XML::HTMLParser.new()
xp.string = xhtml
XML::Parser.default_pedantic_parser = false
doc = xp.parse

My assertxpath gem shows how, in the method assert_libxml.

--
Phlip



.



Relevant Pages

  • Re: html as xml document on IE
    ... opera and safari the html document ... inherits their XML document methods. ... IE does not implement W3C DOM Level 2 for the most part. ...
    (comp.lang.javascript)
  • Re: How to get reference to an object
    ... I also need Comments, Attr, Text...etc ... Are you searching in a HTML document or in an XML document? ...
    (microsoft.public.scripting.jscript)
  • Re: Getting an image from a PHP source and ADOdb
    ... I commented the corresponding header call as per your suggestion but ... I still have no image in my html document. ... The sql is ok (I even at some point used fwrite to write the content of the ...
    (comp.lang.php)
  • Re: HTML META tag
    ... Please post replies to newsgroup. ... I am transforming a XML document into a HTML document using the ...
    (microsoft.public.vb.general.discussion)
  • HTML META tag
    ... I am transforming a XML document into a HTML document using the ... DomDocument's transformNode method. ... For some reason, this following line is ...
    (microsoft.public.vb.general.discussion)