You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Da...@lotus.com on 2000/07/14 18:02:48 UTC

[Xalan-C] Opinions wanted on Function::execute() signature

Hi all,

This will only be of interest to those people interested in Xalan-C
extension functions.  The rest of you can feel free to tune out now...

OK, here's my question.  The signature of Function::execute() is currently:

      virtual XObject*
      execute(
           XPathExecutionContext&        executionContext,
           XalanNode*                    context,
           int                      opPos,
           const XObjectArgVectorType&   args = 0;

but I've been thinking lately that maybe it should be:

      virtual XObject*
      execute(
           XPathExecutionContext&        executionContext,
           const XPath&             xpath,
           XalanNode*                    context,
           int                      opPos,
           const XObjectArgVectorType&   args = 0;


I have a feeling that passing in the currently executing XPath might be of
use to those people interested in implementing extension functions, but I'm
not sure.  It means one more parameter, and no current functions would make
use of this parameter, so it might just be a waste of time.  In fact, I'm
pretty sure that the XPath used to be a parameter a long time ago, and I
removed it because it was never used.  Things you can get from an XPath
include:

   1. The text string used to create the XPath.
   2. The token stream created by parsing the text string.
   3. The op code vector (the "compiled" XPath data)

and probably many other things, as well.

If you have a strong opinion about this, please let me know.  I'd rather
err on the side of too much information rather than find out that someone
needs the XPath instance, and they have no way to get it.

Dave