To instantiate an user extension class, I need to invoke it indirectly through a function named new().
Is the new() an intrinsic function to Saxon or it is part of standard XSLT facilities? I believe it is the former case, Hope some can help confirm with this.
There are no standards for Java extension functions; everything to do with extensions is therefore specific to Saxon.
It's not clear from your post whether you are succeeding in calling the new() function. All the documentation is on the extensibility.html page.
Actually I am succeeding in calling the new() function in the following stylesheet script:
<xsl:variable name="dfu_obj" select="dfu:new()"/>
In the script, the prefixing namespace "dfu" seems to say that the new() function is a method of user-created class fft2st.DateFormat_Unifier, but actually it is not.
Probably the question should be put as "whether new() is embeded in Saxon?"
Appreciate your reply.
If you call a function with local name "new" and namespace URI java:fft2st.DateFormat_Unifier, then Saxon attempts to call the zero-argument constructor for class fft2st.DateFormat_Unifier. This is explained at http://saxon.sourceforge.net/saxon7.8/extensibility.html#Writing-extension-functions
Rather than the User Extensions class, can I say it is the Saxon who owns the function new() - the one returns a XPath value whose type is denoted by the QName java:java.lang.Object?
Sorry, I have no idea what you mean by the question. No-one "owns" functions. If you are having problems using extension functions, please tell me what you are trying to achieve, what you are doing, and in what way it isn't working.
I should have emplasised that I am not having problem using User Extension functions. On the contrary, I have been using them quite successfully - thanks for help of Saxon documentations.
Rather, I am trying to explain the "origin of the function new()" in my thesis.
Put in this way: is the function new() an implicit method of user-created class, which I doubt, or it is of Saxon's?
I think I am confused by the prefix (like "dfu" in my example script) in front of the function new().
How do I make sure that a date literal is in proper format before passing it to functions such as "fn:adjust-dateTime-to-timezone" ?
Such functions throw an exception if the value does not confirm to a valid date literal.
I need a graceful way of finding out if the value is in incorrect format so that I can proceed without calling the function.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.