----- Original Message ----- From: "Hallvard Tratteberg" <[EMAIL PROTECTED]> > Jan, > > > So the same function with the same arguments > > could evaluate to different things in different contexts? > > There are different ways to accomplish such dynamic behavior: > - the mapping from function name to actual function object may in general > depend on the context and arguments > - the function may be a method on the context node > - the function may be coded to handle different contexts and arguments
Agreed. I think all of the above can be done using the existing XPath syntax, parser etc. > > The alternative to a method invocation is to pass the "this" object in an > > argument (see the Perl and the Python programming languages). > > > So instead of > > > > / path / to / somewhere / > > ext:and-now-something-completely-different( 'zz' ) / > > here-we-stand > > > > You could write > > > > ext:and-now-something-completely-different-II( > > / path / to / somewhere, > > 'zz' > > ) / here-we-stand > > Although in the former case the function is called once for each node > ("somewhere" element) in the node set, and hence more naturally maps to > method call. In the latter case, the first argument is a node set (a set of > "somewhere" Elements). Isn't that correct and doesn't that make a > difference? Though the function could always iterate over the nodeset and execute its functionality on each node in the set, and return a new nodeset of all the results. Would that do? James _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com _______________________________________________ Jaxen-interest mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jaxen-interest