From: M. D. P. <m.d...@gm...> - 2005-04-01 13:41:03
|
This is PERFECT!!!! Exactly what I needed :) Between Jeroens reassurance that statically compiled code will work and this vast amount of information you have provided I have no more excuses not to developing a working solution. Cheers to you both. And Jeroen, given that I have you here as part of this Saxon-Help thread, thank you again for everything you have done in bringing together the IKVM.NET project. You're work with this project is absolutely tremendous and I want to make sure that you know how much this project is appreciated, especially in allowing Saxon.NET to reach such a high level of performance in such a short period of time. In regard to you Jeroen, and to Dr. Kay the .NET community is deeply indebted to you both. Best regards, Mark On Apr 1, 2005 6:30 AM, Michael Kay <mi...@sa...> wrote: > > > > I assume you are refering to the released 8.3 build in this regard? > > Yes: though actually, there is one piece missing from the jigsaw. You are > supposed to be able to call setExtensionBinder() on the Configuration > object, but in the issued code this has no effect. However, the fix is > trivial and will appear in a few days. The thing you actually pass is a > FunctionLibrary. Despite its name, this isn't necessarily a fixed repertoire > of functions: rather, it's a class that provides a bind() method which is > given the name and arity of a function call appearing in the stylesheet or > query source, and returns an Expression object responsible for the run-time > implementation of the function. > > Internally, Saxon maintains a list of FunctionLibrary's (one for system > functions, one for constructor functions, one for Saxon extensions, one for > Java extensions, etc) and offers a function call to each of them until it > gets back a non-null response from the bind method (if no FunctionLibrary > expresses an interest, you get a "function not found" error). So you're not > constrained on the meaning you attach to the URI part of the function name. > > The standard Java extension mechanism offered by Saxon is the > JavaExtensionLibrary. Calling setExtensionBinder will override this. But if > you prefer, you can call setExtensionBinder supplying a FunctionLibraryList > (which is also a FunctionLibrary...) that contains your own extension > mechanism alongside the standard JavaExtensionLibrary, in either order. > > > But heres the biggest issue that must be considered with > > this. The latest build of IKVM does not support dynamic class loading > > in external libraries (at least not from a Java class loading > > perspective.) In other words, if its not a part of your compiled > > assembly or part of the main classpath dll theres no way (that I know > > of) to make this work. > > You might consider using the mechanism that the JAXP XPath API uses, which > doesn't rely on dynamic loading. Here the user simply nominates a > FunctionResolver, which is called directly to evaluate the function call. > It's not a very flexible mechanism, but you could use it as a stopgap or > build something more flexible from it. Saxon includes an implementation of > FunctionLibrary, the XPathFunctionLibrary, that supports this mechanism. > > > In fact, I have even had troubles with > > accessing results from the "cli" based class files (java classpath > > works fine) when using the ext:// namespace extension. I think that a > > lot of this has to do with not having a full comprehension of what is > > being bound to this namespace. Is there anything that you can point > > me to that might aid in my study of this? > > Sorry, I'm out of my depth here. > > Michael Kay > http://www.saxonica.com/ > > ------------------------------------------------------- > This SF.net email is sponsored by Demarc: > A global provider of Threat Management Solutions. > Download our HomeAdmin security software for free today! > http://www.demarc.com/info/Sentarus/hamr30 > _______________________________________________ > saxon-help mailing list > sax...@li... > https://lists.sourceforge.net/lists/listinfo/saxon-help > -- <M:D/> :: M. David Peterson :: XML & XML Transformations, C#, .NET, and Functional Languages Specialist |