[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: [xml] document() and import() handlers
- From: Matt Sergeant <matt sergeant org>
- To: Daniel Veillard <veillard redhat com>
- Cc: "xml gnome org" <xml gnome org>
- Subject: Re: [xml] document() and import() handlers
- Date: Sun, 11 Mar 2001 15:12:51 +0000 (GMT)
On Sun, 11 Mar 2001, Matt Sergeant wrote:
> On Sun, 11 Mar 2001, Daniel Veillard wrote:
>
> > On Sun, Mar 11, 2001 at 12:18:02PM +0000, Matt Sergeant wrote:
> > > On Sun, 11 Mar 2001, Daniel Veillard wrote:
> > >
> > > > You can register new handlers, based on the URI string they can intercept
> > > > the default I/O routines of libxml:
> > > > use xmlRegisterInputCallbacks ()
> > > > http://xmlsoft.org/html/libxml-xmlio.html#XMLREGISTERINPUTCALLBACKS
> > > > again it works with a set of 4 callbacks:
> > > > match()
> > > > open()
> > > > read()
> > > > close()
> > >
> > > These methods need to send some sort of user data, otherwise I can't do
> > > per-instance callbacks, and I have no way to do matches in Perl-space.
> >
> > match() should not need it
>
> It doesn't need it if implementing in C space, but Perl is a dynamic
> language, so I want to be able to set the match conditions in Perl space.
> Without any sort of context pointer I can't do that (because I have no way
> of knowing what Perl sub to call from within C-space).
>
> > open() returns the user data associated
> > which is passwd as first arg of
> > read() and close()
>
> Even these methods require a context object, for exactly the same reason
> as match() - I need a Perl SV * to be able to know what Perl method to
> call. Otherwise I have to hard code the method and package name, which is
> not nice.
Just FYI, I got around this limitation by using a global variable. I
assume that this will be OK with libxml because of my calls to
xmlInitParser (which I'm guessing is some sort of mutex mechanism, freed
by the parse finishing?).
--
<Matt/>
/|| ** Founder and CTO ** ** http://axkit.com/ **
//|| ** AxKit.com Ltd ** ** XML Application Serving **
// || ** http://axkit.org ** ** XSLT, XPathScript, XSP **
// \\| // ** mod_perl news and resources: http://take23.org **
\\//
//\\
// \\
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]