Project

Profile

Help

Feature #5477

closed

Provide another way to specify an initializer (config file, feature, etc).

Added by David Cramer 7 months ago. Updated 3 months ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
Configuration
Sprint/Milestone:
-
Start date:
2022-05-06
Due date:
% Done:

0%

Estimated time:
Legacy ID:
Applies to branch:
Fix Committed on Branch:
trunk
Fixed in Maintenance Release:
Platforms:
Java

Description

Beginning in Saxon 9.3 we can pass in a class that implements the interface net.sf.saxon.lib.Initializer to register extension functions: https://www.saxonica.com/documentation10/index.html#!changes/command-line/9.2-9.3

"A new option -init:initializer is available on all command line interfaces. The value is the name of a user-supplied class that implements the interface net.sf.saxon.lib.Initializer; this initializer will be called during the initialization process, and may be used to set any options required on the Configuration programmatically. It is particularly useful for such tasks as registering extension functions, collations, or external object models, especially in Saxon-HE where the option does not exist to do this via a configuration file. Saxon only calls the initializer when running from the command line, but of course the same code may be invoked to perform initialization when running user application code ." (Emphasis added).

However, when using Saxon via a third-party it is not possible to perform the initialization if the application has not given you a hook. The issue exists, for example, In XMLCalabash https://github.com/ndw/xmlcalabash1/issues/335 and until recently, it was not possible to use initializer-based extensions with Schematron in Oxygen.

Please register to edit this issue

Also available in: Atom PDF