At 12:28 pm -0700 22.10.2001, Gary L Peskin wrote:
With the current implementation, you should be able to cast your
ExpressionContext to an XPathContext.XPathExpressionContext ... 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.

My goal was to get back to the Java object that set up the Transformer. Following your advice, I've now accomplished this by:


        a. Using 'transformer.setParameter()' to store the
           object as a parameter to the transformer, and
        b. Doing:

  public String myext(org.apache.xalan.extensions.ExpressionContext
                         econtext,
                      String someotherarg) {
     XPathContext.XPathExpressionContext xpecontext =
        (XPathContext.XPathExpressionContext) econtext;
     XPathContext xpcontext =
        xpecontext.getXPathContext();
     TransformerImpl owner =
        (TransformerImpl) xpcontext.getOwnerObject();
     MyObject object = (MyObject) owner.getParameter("myobject");

It doesn't feel terribly clean, but it certainly gets me where I want to be.

Given that this is doable, I don't think there's really a need to modify 'ExpressionContext', although I suppose if there were a shorter route back to the TransformerImpl, that might allow fractionally cleaner/simpler code.

Thanks for your help,

        A
--
[EMAIL PROTECTED]                             http://pobox.com/~angus

Reply via email to