Re: [xml] document() and import() handlers

On Sun, Mar 11, 2001 at 11:31:41AM +0000, Matt Sergeant wrote:
OK, so I've got XML parsing and output working to my satisfaction. What I
need now is to be able to have libxslt callback to my application for
document() and xsl:import/include.


I haven't seen any examples of how to do this, and Daniel indicated that
it might be possible to do by messing with the IO stuff, but didn't tell
me anything too precise... So I'm looking for more pointers.

   You can register new handlers, based on the URI string they can intercept
the default I/O routines of libxml:
    use xmlRegisterInputCallbacks ()
    again it works with a set of 4 callbacks:

   If you want to be able to catch entities if you implement a catalog
based on their PUBLIC identifier (libxml don't) then you also need to
register an entity loader:
For whatever it's worth, in XML::Sablotron you register a schema handler.
This allows us to set the base to axkit:/path/to/file, and register a
schema handler for "axkit:".

  Libxml scheme is similar as far as i can tell, should be easy to
get both to work together there.

Then any relative URI requests go through our
handler, and http or other requests can be handled elsewhere (do you use
libghttp internally for http requests?).

  Nahh, libxml has its nanoftp and nanohttp own implementations :-)
Libxml depends only on libc (and iconv if present) ...


Daniel Veillard      | Red Hat Network
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]