From: "Hallvard Tratteberg" <[EMAIL PROTECTED]> > > OK lets say its specific to your model - its not part of XPath 1.0 > > And I won't try to push it further either. It was a fun exercise though, and > it showed me that the jaxen/saxpath code is not difficult to work with. > Tribute to the designers!
Thanks! I've really enjoyed this thread - you've shown us how we can achieve object-style method invocation inside the XPath 1.0 standard! This is cool. > > I think I'd rather leave this change for an XPath 2.0 version of Jaxen (if > > ever we do that). XPath can be confusing enough without us > > merging together bits of different versions ;-) > > From a community point of view I guess you're right. I think so. Though on the positive side if you do swizzle your XPath expressions around to use global XPath functions - then at least your XPath expressions are now valid XPath 1.0 and won't break in other tools etc. e.g. some IDE may support validation of XPath 1.0 expressions one day. > > > We should let the java method signature decide if the it should be > called > > > once for the whole node set or once for each node in the set. E.g. a > > > function call like foo(a/b, 1) would call a method > > > public static List foo(List, int) once for the whole set, while it would > call a method > > > public Object foo(int) once for each node in the set and collect the > > > results. > > > > Yes. You're able to create your own FunctionContext with whatever > > Functions > > you wish available with whatever semantics you choose. In this way both > > models can easily be supported in a well defined manner. > > It seems almost all languages that interface with java has functionality for > dynamically finding and invoking java methods from a set of arguments. There > should really be one agreed upon and shared mechanism for all projects! Yes, though each invocation often has its own semantics. Calling an XPath function is quite different from calling a Java method via Method and reflection. So I'm not sure what the shared mechanism would look like. 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