.\" Automatically generated by Pandoc 2.9.2.1 .\" .TH "s1kd-appcheck" "1" "2024-04-01" "" "s1kd-tools" .hy .SH NAME .PP s1kd-appcheck - Validate applicability of S1000D CSDB objects .SH SYNOPSIS .IP .nf \f[C] s1kd-appcheck [options] [...] \f[R] .fi .SH DESCRIPTION .PP The \f[I]s1kd-appcheck\f[R] tool validates the applicability of S1000D CSDB objects, detecting potential errors that could occur when the object is filtered. .PP By default, the tool validates an object against only the product attribute and condition values which are explicitly used within the object. The products check (-t) and full check (-a) modes allow objects to be checked for issues with implicit applicability, that is, product attribute or condition values which are not explicitly used within an object, but may still affect it. .PP The s1kd-instance and s1kd-validate tools are used by default to perform the actual validation. .SH OPTIONS .TP -A, --act Specify the ACT to read product attributes from, and to use to find the CCT or PCT. This will override the ACT reference within the individual objects being validated. .TP -a, --all Validate objects against all possible combinations of relevant product attribute and condition values as defined in the ACT and CCT. Relevant product attributes and conditions are those that are used by an object with any value. .TP -b, --brexcheck Validate objects with a BREX check (using the s1kd-brexcheck tool) in addition to the schema check. .TP -C, --cct Specify the CCT to read conditions from. This will override the CCT reference within the ACT. .TP -c, --custom Perform a customized check. The default standalone applicability check is disabled. This can then be combined with the -s option, to only check that all product attributes and conditions are defined in the ACT and CCT respectively, and/or the -n option, to only check nested applicability annotations. If neither of these options are specified, no checks will be performed. .TP -D, --duplicate Check for duplicate annotations. .TP -d, --dir The directory to start searching for ACT/CCT/PCT data modules in. By default, the current directory is used. .TP -e, --exec The commands used to validate objects. Multiple commands can be used by specifying this option multiple times. The objects will be passed to each command on stdin, and the exit status of the command will be used to determine if the object is valid (with a non-zero exit status indicating it is invalid). This overrides the default commands (s1kd-validate, and s1kd-brexcheck if -b is specified). .TP -F, --valid-filenames Print the filenames of valid objects. .TP -f, --filenames Print the filenames of invalid objects. .TP -h, -?, --help Show help/usage message. .TP -K, --filter The command used to filter objects prior to validation. The objects will be passed to the command on stdin, and the filters will be supplied as arguments in the form of \[dq]\f[C]-s :=\f[R]\[dq]. This overrides the default command (s1kd-instance). .TP -k, --args The arguments to the filter command when filtering objects prior to validation. .TP -l, --list Treat input as a list of CSDB objects to validate. .TP -N, --omit-issue Assume that the issue/inwork numbers are omitted from object filenames (they were created with the -N option). .TP -n, --nested Check that all product attribute and condition values used in nested applicability annotations are subsets of the values used in their parents. .TP -o, --output-valid Output valid CSDB objects to stdout. .TP -P, --pct Specify the PCT to read product instances from. This will override the PCT reference in the ACT. .TP -p, --progress Display a progress bar. .TP -q, --quiet Quiet mode. Error messages will not be printed. .TP -R, --redundant Check for redundant annotations. .TP -r, --recursive Search for the ACT/CCT/PCT recursively. .TP -s, --strict Check whether product attributes and conditions used by an object are declared in the ACT and CCT respectively. .TP -T, --summary Print a summary of the check after it completes, including statistics on the number of objects that passed/failed the check. .TP -t, --products Validate objects against the defined product instances within the PCT. .TP -v, --verbose Verbose output. Specify multiple times to increase the verbosity. .TP -x, --xml Print an XML report of the check. .TP -\[ti], --dependencies Check with CCT dependency tests added to assertions which use the dependant values. .TP -\[ha], --remove-deleted Validate objects with elements that have a change type of \[dq]delete\[dq] removed. .TP --version Show version information. .TP --zenity-progress Print progress information in the zenity --progress format. .TP ... Object(s) to validate. .PP In addition, the following options allow configuration of the XML parser: .TP --dtdload Load the external DTD. .TP --huge Remove any internal arbitrary parser limits. .TP --net Allow network access to load external DTD and entities. .TP --noent Resolve entities. .TP --parser-errors Emit errors from parser. .TP --parser-warnings Emit warnings from parser. .TP --xinclude Do XInclude processing. .TP --xml-catalog Use an XML catalog when resolving entities. Multiple catalogs may be loaded by specifying this option multiple times. .SH EXIT STATUS .TP 0 The check completed successfully, and all CSDB objects were valid. .TP 1 The check completed successfully, but some CSDB objects were invalid. .TP 2 One or more CSDB objects could not be read. .TP 3 The number of CSDB objects specified exceeded the available memory. .TP 4 The commands used to filter and/or validate objects failed to be executed. .SH EXAMPLES .SS Standalone validation .PP Consider the following data module snippet: .IP .nf \f[C] \&... Version: A or Version: B \&... \&... Features of version B ... \&... More information ... Refer to . \&... \f[R] .fi .PP There are two versions of the product, A and B, and the data module is meant to apply to both. .PP By itself, the data module is valid: .IP .nf \f[C] $ s1kd-validate -v s1kd-validate: SUCCESS: validates against schema \f[R] .fi .PP Checking it with this tool, however, reveals an issue: .IP .nf \f[C] $ s1kd-appcheck s1kd-appcheck: ERROR: is invalid when: s1kd-appcheck: ERROR: prodattr version = A \f[R] .fi .PP When the data module is filtered for version A, the first levelled paragraph will be removed, which causes the reference to it in the second levelled paragraph to become broken. .SS Full validation .PP Consider the following data module snippet: .IP .nf \f[C] \&... All \&... \&... Locate the handle. Put on gloves prior to touching the handle. Grab the handle and turn it clockwise. \&... Remove the gloves you put on in . \&... \f[R] .fi .PP Once again, this data module is valid by itself: .IP .nf \f[C] $ s1kd-validate -v s1kd-validate: SUCCESS: validates against schema \f[R] .fi .PP This time, however, it also initially appears valid when this tool is used: .IP .nf \f[C] $ s1kd-appcheck -v s1kd-appcheck: SUCCESS: passed the applicability check. \f[R] .fi .PP However, now consider this snippet from the CCT: .IP .nf \f[C] \&... Weather type Possible types of weather conditions. \&... Weather The current weather conditions. \&... \f[R] .fi .PP There is a third value for the \f[C]weather\f[R] condition which is not explicitly used within the data module, and therefore will not be validated against in the default standalone check. When \f[C]weather\f[R] has a value of \f[C]Normal\f[R], the cross-reference in the last step in the example above becomes broken. .PP To catch errors with implicit applicability, the full check (-a) can be used instead, which reads the values to check not from the data module itself, but from the ACT and CCT referenced by the data module: .IP .nf \f[C] $ s1kd-appcheck -a s1kd-appcheck: ERROR: is invalid when: s1kd-appcheck: ERROR: condition weather = Normal \f[R] .fi .PP This can also be fixed by making the applicability of the data module explicit: .IP .nf \f[C] Weather: Normal or Weather: Icy or Weather: Hot \f[R] .fi .PP In which case, the standalone check will now also detect the error: .IP .nf \f[C] $ s1kd-appcheck s1kd-appcheck: ERROR: is invalid when: s1kd-appcheck: ERROR: condition weather = Normal \f[R] .fi .SS Nested applicability annotations .PP Consider the following data module snippet: .IP .nf \f[C] \&... Version: A, B \&... Version: C \&... Step A Step B Step C \&... \f[R] .fi .PP Here, the whole data module is applicable to versions A and B, but an individual step has been made applicable to version C. Normally, this is not reported as an error, since the removal of this step would not cause the data module to become invalid: .IP .nf \f[C] $ s1kd-appcheck -v s1kd-appcheck: SUCCESS: passed the applicability check \f[R] .fi .PP However, the content is essentially useless, since it will never appear. The -n option will report when the applicability of an element is incompatible with the applicability of any parent elements or the whole object: .IP .nf \f[C] $ s1kd-appcheck -n s1kd-appcheck: ERROR: : proceduralStep on line 62 is applicable when prodattr version = C, which is not a subset of the applicability of the whole object. \f[R] .fi .SS Redundant applicability annotations .PP Consider the following data module snippet: .IP .nf \f[C] Step A
\&...
\f[R] .fi .PP This is technically correct, but the annotation on the figure can be considered redundant, since it has the same applicability as its ancestor, and the applicability of an element is already inherited by all its descendants automatically. .PP The -R (--redundant) option will report when the applicability of a nested element is redundant: .IP .nf \f[C] $ s1kd-appcheck -R s1kd-appcheck: ERROR: : figure on line 85 has the same applicability as its parent proceduralStep on line 83 (app-A) \f[R] .fi .PP Currently, this check only detects when the exact same annotation (with the same ID) is nested within itself. In the future, this should also detect redundant logic between different nested annotations. .SS Duplicate applicability annotations .PP Consider the following data module snippet: .IP .nf \f[C] \f[R] .fi .PP These annotations have duplicate logic, meaning only one is necessary. The -D (--duplicate) option will report when an applicability annotation is a duplicate of another annotation: .IP .nf \f[C] $ s1kd-appcheck -D s1kd-appcheck: ERROR: : Annotation on line 47 is a duplicate of annotation on line 24. \f[R] .fi .SH AUTHORS khzae.net.