You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Experience with user-defined functions in XQuery and XSLT reveals that they can be a powerful addition to the language. Providing some feature that allowed users to extend the vocabulary of functions available in, for example, the test expressions on p:when elements would greatly simplify some pipelines.
Such a mechanism might take the form of the ability to load extension functions defined in, for example, XQuery, or it might include adding the ability to define functions in XProc.
The text was updated successfully, but these errors were encountered:
It would be useful to be able to add user-defined functions to XProc. XProc steps themselves don't immediately lend themselves to this task because there's not a completely obvious mapping between step signatures and function signatures. However, most XProc engines are going to have access to XSLT and/or XQuery engines and both of those languages have a built-in mechanism for creating functions.
This proposal is for a p:import-functions element that can import externally-defined functions from languages such as XQuery or XSLT.
This element instruct the XProc processor to load external functions from the specified library. It is a static error if the processor cannot access the URI or if the URI points to a format that the implementation does not recognize.
The namespace attribute specifies the namespace in which the imported functions must reside. It is a static error if the specified URI does not define functions in that namespace.
The type attribute specifies the expected type of the content. Implementations should support application/xslt+xml and application/xquery for XSLT and XQuery implementations. Support for other formats is impelementation-defined.
Experience with user-defined functions in XQuery and XSLT reveals that they can be a powerful addition to the language. Providing some feature that allowed users to extend the vocabulary of functions available in, for example, the test expressions on p:when elements would greatly simplify some pipelines.
Such a mechanism might take the form of the ability to load extension functions defined in, for example, XQuery, or it might include adding the ability to define functions in XProc.
The text was updated successfully, but these errors were encountered: