Re: [xml] Ignoring undefined entities



On Thu, May 16, 2002 at 12:45:09PM -0400, Michael Rothwell wrote:
Is there a way to ignore undefined entities? Or to take some default action
(i.e., insert some standard replacement text, like a comment, into the
document in place of the undefined entity) using a callback function or
other means?

  Look at SAX.c, override the default entities entities handling routines
with your in the default SAX handler. For example testXPath.c does 
something similar to avoid generating CDATA blocks in the tree:
           xmlDefaultSAXHandlerInit();
           xmlDefaultSAXHandler.cdataBlock = NULL;

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



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