Advanced Saxon HE/PE/EE XSLT Transformation Options
The XSLT transformation scenario allows you to configure advanced options that are specific for the Saxon HE (Home Edition), PE (Professional Edition), and EE (Enterprise Edition) engines. They are the same options as those in the Saxon HE/PE/EE preferences page but they are configured as a specific set of transformation options for each transformation scenario, while the values set in the preferences page apply as global options. The advanced options configured in a transformation scenario override the global options defined in the preferences page.
The advanced options for Saxon 9.6.0.7 Home Edition (HE), Professional Edition (PE), and Enterprise Edition (EE) are as follows:
- Mode ("-im")
- A Saxon-specific option that sets the initial mode for the transformation.
- Template ("-it")
- A Saxon-specific option that sets the name of the initial XSLT template to be executed.
- Use a configuration file ("-config")
- Sets a Saxon 9.6.0.7 configuration file that is executed for XSLT transformation and validation processes.
- Version warnings ("-versmsg")
- Warns you when the transformation is applied to an XSLT 1.0 stylesheet.
- Line numbering ("-l")
- Line numbers where errors occur are included in the output messages.
- Expand attributes defaults ("-expand")
- Specifies whether or not the attributes defined in the associated DTD or XML Schema are expanded in the output of the transformation you are executing.
- DTD validation of the source ("-dtd")
- Specifies whether or not the source document will be validated against their
associated DTD. You can choose from the following:
-
On - Requests DTD validation of the source file and of any
files read using the
document()
function. - Off - (default setting) Suppresses DTD validation.
-
Recover - Performs DTD validation but treats the errors as
non-fatal.
Note
Any external DTD is likely to be read even if not used for validation, since DTDs can contain definitions of entities.
-
On - Requests DTD validation of the source file and of any
files read using the
- Recoverable errors ("-warnings")
- Allows you to choose how dynamic errors are handled. The following options can be
selected:
- Recover silently ("silent") - Continues processing without reporting the error.
- Recover with warnings ("recover") - Issues a warning but continues processing.
- Signal the error and do not attempt recovery ("fatal") - Issues an error and stops processing.
- Strip whitespaces ("-strip")
- Allows you to choose how the strip whitespaces operation is handled. You
can choose one of the following values:
- All ("all") - Strips all whitespace text nodes from
source documents before any further processing, regardless of any
xml:space
attributes in the source document. - Ignore ("ignorable") - Strips all ignorable
whitespace text nodes from source documents before any further processing,
regardless of any
xml:space
attributes in the source document. Whitespace text nodes are ignorable if they appear in elements defined in the DTD or schema as having element-only content. - None ("none") - Strips no whitespace before further processing.
- All ("all") - Strips all whitespace text nodes from
source documents before any further processing, regardless of any
- Optimization level ("-opt")
- Allows you to set the optimization level. It is the value is an integer in the range of 0 (no optimization) to 10 (full optimization). This option allows optimization to be suppressed when reducing the compiling time is important, optimization conflicts with debugging, or optimization causes extension functions with side-effects to behave unpredictably.
- Initializer class
- Equivalent to the -init Saxon command-line argument. The value is the
name of a user-supplied class that implements the
net.sf.saxon.lib.Initializer
interface. This initializer is called during the initialization process, and may be used to set any options required on the configuration programmatically. It is particularly useful for tasks such as registering extension functions, collations, or external object models, especially in Saxon-HE where the option cannot be set via a configuration file. Saxon only calls the initializer when running from the command line, but the same code may be invoked to perform initialization when running user application code.
The following advanced options are specific for Saxon 9.6.0.7 Professional Edition (PE) and Enterprise Edition (EE) only:
- Register Saxon-CE extension functions and instructions
- Registers the Saxon-CE extension functions and instructions when compiling a stylesheet using the Saxon 9.6.0.7 processors.
- Allow calls on extension functions ("-ext")
- If checked, the stylesheet is allowed to call external Java functions. This does not
affect calls on integrated extension functions, including Saxon and EXSLT extension
functions. This option is useful when loading an untrusted stylesheet (such as from
a
remote site using
http://[URL]
). It ensures that the stylesheet cannot call arbitrary Java methods and thus gain privileged access to resources on your machine.
- XML Schema version
- Use this option to change the default XML Schema version for this transformation. To change the default XML Schema version globally, open the Preferences dialog box and go to and use the Default XML Schema version option.
- Validation of the source file ("-val")
- Requests schema-based validation of the source file and of any files read using
document()
or similar functions. It can have the following values:- Schema validation ("strict") - This mode requires an XML Schema and enables parsing the source documents with strict schema-validation enabled.
- Lax schema validation ("lax") - If an XML Schema is provided, this mode enables parsing the source documents with schema-validation enabled but the validation will not fail if, for example, element declarations are not found.
- Disable schema validation - This specifies that the source documents should be parsed with schema-validation disabled.
- Validation errors in the result tree treated as warnings ("-outval")
- Normally, if validation of result documents is requested, a validation error is fatal.
Enabling this option causes such validation failures to be treated as warnings.
- Write comments for non-fatal validation errors of the result document
- The validation messages for non-fatal errors are written (wherever possible) as a comment in the result document itself.
- Generate bytecode ("--generateByteCode:(on|off)")
- If you enable this option, Saxon-EE attempts to generate Java bytecode for evaluation of parts of a query or stylesheet that are amenable to such an action. For further details regarding this option, go to http://www.saxonica.com/documentation9.5/index.html#!javadoc.