From: Tommy Nordgren Date: 2008-07-30T02:48:35+09:00 Subject: Re: libxml: is it possible not to use doctype declaration? On 29 jul 2008, at 15.44, ruud grosmann wrote: > hi all, > > I have tried to find elements in XML documents with xpath expression > support in libxml: > > require 'xml/libxml' > doc = XML::Document.file( file) > node = doc.find_first( 'doc/p[@att]/@att') > > 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. > > Is there a way to tell the Document-object that it should ignore the > doctype declaration if present? Or should I first remove the > declaration from the document before calling new? > > regard, Ruud > Check wether your xml processor supports xml catalog files. They provide a mapping from web-based paths to local file names. ------------------------------------- This sig is dedicated to the advancement of Nuclear Power Tommy Nordgren tommy.nordgren@comhem.se