Angus --

I don't think you should use a static class.  In theory, you could be
called from a multi-threaded environment which would confuse things.
With the current implementation, you should be able to cast your
ExpressionContext to an XPathContext.XPathExpressionContext.  Then use
the getXPathContext() method on that and that should give you an
XPathContext.  Everything you need should be there.

The code would look something like this:

  XPathContext.XPathExpressionContext xpec =
(XPathContext.XPathExpressionContext) myExprCtxtArg;
  XPathContext xctxt = xpec.getXPathContext();
  // additional calls to methods of XPathContext to get items of
interest.

Please let us know what you're looking for so that we can consider
providing these directly from the ExpressionContext without your having
to crawl around.

Gary

> -----Original Message-----
> From: Angus McIntyre [mailto:[EMAIL PROTECTED] 
> Sent: Monday, October 22, 2001 11:47 AM
> To: Gary L Peskin
> Subject: RE: Extension elements/functions: how to get context?
> 
> 
> At 7:30 am -0700 22.10.2001, Gary L Peskin wrote:
> >If you specify an ExpressionContext as your first argument, 
> it will be 
> >passed to your extension function.  You can get what you need from 
> >there.  If there are things you need that you can't find through 
> >ExpressionContext, please let us know and we'll point you in 
> the right 
> >direction or enhance ExpressionContext as appropriate.
> 
> Thanks very much for your reply.
> 
> As far as I can see, I can get a Node from the ExpressionContext, and 
> a Document from the Node, and a DocumentImplementation from the 
> Document ...
> 
> What's not clear to me is where I go from there, and specifically how 
> I get back to the objects in my program that are actually working on 
> the document (ideally, my main application class, but optionally the 
> Transformer object). However, I think that the easiest way to do that 
> will be with a static class (the usual Java 'hack' to compensate for 
> not having globals ...).
> 
> Thanks again for all your help.
> 
> Angus
> -- 
> [EMAIL PROTECTED]                             http://pobox.com/~angus
> 

Reply via email to