Re: [xml] register i/o callback functionality

On Sat, May 29, 2004 at 08:43:25AM -0400, Rob Richards wrote:
Since the input is "just" the URI string, and that string may come from
within the document it seems only an API addition is possible, this is
not gonna be easy to design,

Attached is a diff which I am using as a proof of concept for overriding the
xmlParserInputBufferCreateFilename function (didnt bother with the output at
this time). This is a much smaller change and does not break BC. Since I am
trying to override all the File handling to use our streams, by doing this
there is no longer a need to register our stream handlers anymore.

It isnt pretty looking since its just a down and dirty POC (cut and pasted
the registernode functionality for the globals and used some really long
variable names), but seemed to work in my tests.

On the request startup I set xmlRegisterParserInputBufferCreateFilenameValue
to my internal function and on the request shutdown set it back to NULL so
that it would be set back to its default handling.

Would this be an appropriate solution to our current issue?


I'm always vary of adding Yet Another Global Variable. On the other hand it
seems to do the job it is designed for. What I would like to be sure is
that it is really the proper level in the API to make the plug, i.e. that
all URI loading functionnality will actually be tunelled though those
user-provided functions, the worse would be to make the change, and then
realize later that some part of the library actually bypass it, it would make
this dangerous.
Please bugzilla it as an RFE with the patch, so we keep track of it :-)


Daniel Veillard      | Red Hat Desktop team
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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