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



Hello.  I have stylesheets that are used both client side (via
Firefox) but also server side for HTML-only servers.  When I do a
document(...) on the client, authentication is taken care of via
normal mechanism. However, on the server side, I don't know how I
can pass the current authenticated user session from the 'applyStylesheet' 
line into where the resolver returns the appropriate content.

In particular, when I'm applying my stylesheet, I know who my 'user'
is, and I need this information in my resolver.  I'd like to do
something like:

def resolver(URI, ID, cntx):
    userid = libxslt.getContextParameter(cntx,'userid')
    ...

libxml2.setEntityLoader(resolver)

def transform(userid, ...):
    ...
    context = contextParameters(userid='bingles')
    result = style.applyStylesheet(src, args, context)

Anything like this possible?  Given that the transform can also
happen client side I'd rather not use the args (as this is 
a serverside only thing), but if I can use args, this is _OK_,
I just don't know how it would work.

Cheers!

Clark


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]