Re: [xml] ignore undefined namespaces during parsing



On Fri, Sep 04, 2009 at 05:26:41AM -0700, mini thomas wrote:
Yes I have used xerces. But now I need to use libxml2 and the main road block is strict namespace 
validation. So waiting for Daniel's response.

  I would not suggest to ignore namespace errors in general but
if you're trying to rtetrofit in an older framework I can understand.

  libxml2 won't consider namespace error fatal error. If your
tree is otherwise wellformed XML-1.0 it will output the namespace
errors but you still get a tree, i.e. the parsing suceeded.
  If you want to ignore namespace errors simply set a structured
error handler and skip errors and warnings coming with the
XML_FROM_NAMESPACE domain.

  I suggest to use the xmlRead* parsing functions (or the reader)
and the xmlSaveTo* for processing since you're converting to libxml2
it's better to use the new set of entry points.

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel veillard com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]