Script documentation

A general overview of the usage of the Escali Schematron is already provided on the Concept page. Here, the detailed usage of the individual Escali components is explained which can be downloaded at the Download section.

Overview

On this page, the usage of the following XSLT scripts is explained:

Folder

File name

Short name

Task

Compiler

01_compiler

escali_compiler_0_functions.xsl

0_functions.xsl

  • Function library

escali_compiler_0_getSchemaInfo.xsl

0_getSchemaInfo.xsl

  • Retrive meta informations of a Schematron schema

  • Analyze the phases, languages, etc.

escali_compiler_0_validate.xsl

0_validate.xsl

  • Preparation to validate the Schematron schema.

  • Resolving the includes/imports

escali_compiler_1_include.xsl

comp_1_include.xsl

  • <sch:include>

  • @role

  • <es:inactive>

  • <es:import>

  • Language filter

escali_compiler_1_sqf-params.xsl

comp_1_sqf-params.xsl

  • <sqf:call-fix>

  • <sqf:param>

escali_compiler_2_abstract-patterns.xsl

comp_2_abstract-patterns.xsl

  • @abstract (<sch:pattern>, <sch:rule>)

escali_compiler_2_sqf-user-entry.xsl

comp_2_sqf-user-entry.xsl

  • <sqf:param> (<sqf:user-entry>)

escali_compiler_3_main.xsl

comp_3_main.xsl

  • Schematron compiling

escali_compiler_3_sqf-main.xsl

comp_3_sqf-main.xsl

  • Schematron QuickFix compiling

escali_compiler_3_sqf-main-xsm.xsl

comp_3_sqf-main-xsm.xsl

  • Compiling parts regarding to the XML save mode only.

escali_compiler_3_sqf-main-no-xsm.xsl

comp_3_sqf-main-no-xsm.xsl

  • Compiling parts regarding not to the XML save mode.

Validator

*

escali_validator_1_main.xsl

val_1_main.xsl

  • Main validation

02_validator

escali_validator_2_postprocess.xsl

val_2_postprocess.xsl

  • Sorting of the SVRL

escali_validator_2_sqf-postprocess.xsl

val_2_sqf-postprocess.xsl

  • @sqf:default-fix

escali_validator_3_html-report.xsl

val_3_html-report.xsl

  • HTML output

escali_validator_3_escali-report.xsl

val_3_escali-report.xsl

  • Escali XML report

escali_validator_3_text-report.xsl

val_3_text-report.xsl

  • Text report output

Extractor

03_extractor

escali_extractor_1_main.xsl

res_1_main.xsl

  • Generation of the manipulator

escali_extractor_1_get-record.xsl

res_1_get-record.xsl

  • Recording of executed QuickFixes

Manipulator

*

escali_manipulator_1_main.xsl

man_1_main.xsl

  • Execution of the QuickFixes

  • Or: generation of the XSM sheet

04_manipulator

escali_manipulator_2_postprocess.xsl

man_2_postprocess.xsl

  • Change-PIs for attributes

* XSLT stylesheets written in italics are generated and cannot be found in the Escali package.

Step 1: generating the validator

The compiler process generates from the Schematron schema the main stylesheet of the validator (val_1_main.xsl).

Overview table

Input:

Schematron schema

Output:

escali_validator_1_main.xsl

Stylesheets to call:

  1. escali_compiler_1_include.xsl

  2. escali_compiler_2_abstract-patterns.xsl

  3. escali_compiler_3_main.xsl

Parameters

The following settings can be made with parameters:

Stylesheet

Parameter

Type

Default values

Description

escali_compiler_1_include.xsl

es:lang

xs:string+

#default

Language filter

es:type-available

true

Indicates with true or false whether the engine supports types or not (especially important for XProc). However, the false value may lead to type errors, in case types are used in the Schematron schema.

roles

xs:string*

('info|information', 'warn|warning', 'error', 'fatal')

Indicates with a list sorted hierarchically in ascending order all possible values for the Schematron role attribute (of the elements <sch:assert>, <sch:report> and <sch:rule>). The hierachy of the values should correspond to the order in the list, whereby the value with the lowest hierarchy should be stated first.

escali_compiler_3_main.xsl

phase

xs:string+

if (/sch:schema/@defaultPhase) then (/sch:schema/@defaultPhase) else ('#ALL')

Determines the phase which shall apply for the validation.

sqf:changePrefix

xs:string

sqfc

Indicates a prefix for the PIs which mark the changes made by a QuickFix (Change-PIs).

sqf:useSQF

xs:boolean

Automated check whether SQF elements are used.

With this parameter, the Schematron QuickFix functionality can be manually activated or deactivated.

xsm:xml-save-mode

xs:boolean

true

Indicates whether the XML-save mode shall be used. In this case, the manipulator generates a XSM sheet instead of fixing the XML document directly.

es:use-for-each.maximum

xs:integer

50

Set a maximum number of permitted generated QuickFixes using the use-for-each attribute.

Step 2: validating the XML document

The validator generated in step 1 is used in order to create from the XML document a SVRL report – the result of the Schematron validation. Optionally, the SVRL report can be transformed into different output formats:

Overview table

Input:

XML document

Output:

SVRL report / HTML report / Escali XML report / Text report

Stylesheets to call:

  1. escali_validator_1_main.xsl

  2. escali_validator_2_postprocess.xsl

  3. Optional:

    escali_validator_3_html-report.xsl (HTML report)

    or escali_validator_3_escali-report.xsl (Escali XML report)

    or escali_validator_3_text-report.xsl (Text report)

Parameters

Normally, the process has no parameters. However, parameters could be defined for this process with an Escali extension. In that case, number, names and types are dependent on the used Schematron schema.

Step 3: selecting the QuickFix, generating the manipulator

For this step, the user has to select one or more QuickFixes which he wants to execute. By means of this selection, the SVRL report is transformed to the manipulator.

Overview table

Input:

SVRL report

Output:

escali_manipulator_1_main.xsl

Stylesheet to call:

  1. escali_extractor_1_main.xsl

Parameters

The following parameters are necessary to control the functionality of the extractor:

Stylesheet

Parameter

Type

Default values

Description

escali_extractor_1_main.xsl

id

xs:string+

Empty sequence

IDs of the QuickFixes which shall be executed. Without indication of an ID, no QuickFix is executed.

outputRecord

xs:string

Empty string

This parameter is designated for an additional function of the extractor. With this function, a record file can be generated indicating which QuickFixes were executed.

The value of the parameter determines by a path the file for the record. If an empty string is passed on, no record is generated.

inputRecord

xs:string

Empty string

For the continuation of the record function of the extractor. If several QuickFixes are consecutively executed, each path to the preceding record file can be indicated here.

If an empty string is indicated or in the indicated path no well-formed XML document is available, a new record is generated.

markChanges

xs:boolean

true

By using true / false, this parameter indicates whether change-markers shall be set.

missing-fixes-handle

xs:integer

2

This parameter indicates, how to handle the case, if one ore more QuickFixes which the user selected is not available. The value 2 (default) indicates, that the process should be aborted, the value 1 occurs a warning message and the value 0 ignores missing QuickFixes.

Step 4: executing the manipulator

Now, the manipulator generated in step 3 can fix the XML document in a XSLT transformation or generate from the XML document a XSM sheet which fixes the XML document with the help of a XSM processor.

Overview table

Input:

XML document

Output:

fixed XML document / XSM sheet

Stylesheets to call:

  1. escali_manipulator_1_main.xsl

  2. escali_manipulator_2_postprocess.xsl

Parameters

Normally, the process has no parameters. However, if the selected QuickFixes are provided with user entries, further parameters can be required here which are used to assign the appropriate values to the user entries.

© Copyright 2014-2016 Nico Kutscherauer

ImprintContactSitemap