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

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