Re: [xslt] Re: passing info from 'apply' to an EntityLoader



On Fri, Dec 10, 2004 at 10:09:52AM -0500, Clark C. Evans wrote:
> On Fri, Dec 10, 2004 Daniel Villard wrote:
> | From C you can use the _private pointer in the transformation
> | context to store informations. But I don't think it's available from
> | the Python bindings. Another option is to make your authentication
> | informations parameters to the stylesheet, it should be easier to
> | retrieve them from Python.
> 
> Daniel,
> 
> Thank you for responding, your help as always wonderful.  I'm not 
> clear as to how I can do this.  It's easy to set an argument via
> style.applyStylesheet(document, { 'userid': "'12345'" }) but how
> do I access 'userid' from the resolver?
> 
>  def resolver(URI, ID, cntx):
>      userid = ?
>      ...
>  
>  libxml2.setEntityLoader(resolver)

  Hum, the loader at the libxml2 level has no knowledge of the upper
layer libxslt. I'm afraid this is not simple even when working at the
C level with all the control, and probably impossible at the Python
level. The ctxt passed to the resolver is a parsing context. 
  At the C level the loader could use the new loader function

    http://xmlsoft.org/XSLT/html/libxslt-documents.html#xsltSetLoaderFunc

which then have pointers to the stylesheet context or the transformation
context. But I don't think there is bindings available at the Python level
for this yet.

Daniel

-- 
Daniel Veillard      | Red Hat Desktop team http://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]