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



On Sun, 11 Mar 2001, Daniel Veillard wrote:

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.

   Read http://xmlsoft.org/xmlio.html#General

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 ()
    http://xmlsoft.org/html/libxml-xmlio.html#XMLREGISTERINPUTCALLBACKS
    again it works with a set of 4 callbacks:
    match()

OK, should this return 0 or 1 for a valid match?

I assume returning "false" (whichever of 0 or 1 that is), means that
libxml uses the default callbacks?

    open()
    read()
    close()

   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:

  http://xmlsoft.org/xmlio.html#entities

Yep, that's already implemented.

-- 
<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]