Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 1.1
-
Fix Version/s: None
-
Component/s: function
-
Labels:None
-
Number of attachments :
Description
As near as I can tell there's no rule in XPath 1.0 that requires extension functions to be in a namespace. That is, the function library is not limited to functions defined in the XPath spec. The list there is minimal, not exclusive. However, in XSLT there is a requirement that extension functions not defined in either XPath or XSLT be in a namespace:
The argument must evaluate to a string that is a QName. The QName is expanded into an expanded-name using the namespace declarations in scope for the expression. The function-available function returns true if and only if the expanded-name is the name of a function in the function library. If the expanded-name has a non-null namespace URI, then it refers to an extension function; otherwise, it refers to a function defined by XPath or XSLT.
In other words, if Jaxen provides the org.jaxen.function.ext functions to an XSLT implementation the XSLT implementation is in error. On the other hand, it would be possible for the XSLT implementation to define its own function context that doesn't include the ext functions. It would even be possible for the XSLT implementation to map the org.jaxen.function.ext functions to to a different namespace URI.
My gut is that we should fix XPathFunctionContext so that the extension functions are registered in a namespace such as http://functions.jaxen.org/ but I'm not 100% convinced that's necessary. It might cause problems for people already using these functions. We could have a deprecation cycle in which both namespaced and nonnamespaced functions were available. That is, we could register the extension functions twice. once with and once without namespaces.
So the first question is, what, if anything should be done here?
The second question is if we change the namespace, when should we do it? For 1.1 or 1.2?