..
/
download
.\" Automatically generated by Pandoc 2.9.2.1
.\"
.TH "s1kd-fmgen" "1" "2021-04-16" "" "s1kd-tools"
.hy
.SH NAME
.PP
s1kd-fmgen - Generate front matter data module contents
.SH SYNOPSIS
.IP
.nf
\f[C]
s1kd-fmgen [-D <TYPE>] [-F <FMTYPES>] [-I <date>] [-P <PM>]
[-p <name>=<val> ...] [-t <TYPE>] [-x <XSL>]
[-,.flqvh?] [<DM>...]
\f[R]
.fi
.SH DESCRIPTION
.PP
The \f[I]s1kd-fmgen\f[R] tool generates the content section for front
matter data modules from either a standard publication module, or the
combined format of the s1kd-flatten(1) tool.
Some front matter types require the use of the combined format,
particularly those that list information not directly found in the
publication module, such as the highlights (HIGH) type.
.SH OPTIONS
.TP
-,, --dump-fmtypes-xml
Dump the built-in \f[C].fmtypes\f[R] XML format.
.TP
-., --dump-fmtypes
Dump the built-in \f[C].fmtypes\f[R] simple text format.
.TP
-D, --dump-xsl <TYPE>
Dump the built-in XSLT used to generate the specified type of front
matter.
.TP
-F, --fmtypes <FMTYPES>
Specify a custom \f[C].fmtypes\f[R] file.
.TP
-f, --overwrite
Overwrite the specified front matter data module files after generating
their content.
.TP
-h, -?, --help
Show usage message.
.TP
-I, --date <date>
Set the issue date of the generated front matter data modules.
This can be a specific date in the form of \[dq]YYYY-MM-DD\[dq],
\[dq]-\[dq] for the current date, or \[dq]pm\[dq] to use the issue date
of the publication module.
.TP
-l, --list
Treat input (stdin or arguments) as lists of front matter data modules
to generate content for, rather than data modules themselves.
If reading list from stdin, the -P option must be used to specify the
publication module.
.TP
-P, --pm <PM>
Publication module or s1kd-flatten(1) PM format file to generate
contents from.
If none is specified, the tool will read from stdin.
.TP
-p, --param <name>=<value>
Pass a parameter to the XSLT stylesheets used to generate the front
matter content.
Multiple parameters can be specified by using this option multiple
times.
.RS
.PP
The following parameters are automatically supplied to any stylesheet,
and therefore their names should be considered reserved:
.IP \[bu] 2
\f[C]\[dq]type\[dq]\f[R] - The front matter type name (e.g., HIGH) that
was matched in the \f[C].fmtypes\f[R] file or specified by the user with
the -t option.
.RE
.TP
-q, --quiet
Quiet mode.
Do not print errors.
.TP
-t, --type <TYPE>
Generate content for this type of front matter.
Supported types are:
.RS
.IP \[bu] 2
HIGH - Highlights
.IP \[bu] 2
LOA - List of abbreviations
.IP \[bu] 2
LOASD - List of applicable specifications and documentation
.IP \[bu] 2
LOEDM - List of effective data modules
.IP \[bu] 2
LOI - List of illustrations
.IP \[bu] 2
LOS - List of symbols
.IP \[bu] 2
LOT - List of terms
.IP \[bu] 2
LOTBL - List of tables
.IP \[bu] 2
TOC - Table of contents
.IP \[bu] 2
TP - Title page
.RE
.TP
-v, --verbose
Verbose output.
Specify multiple times to increase the verbosity.
.TP
-x, --xsl <XSL>
Use the specified XSLT script to generate the front matter contents
instead of the built-in XSLT or the user-configured XSLT from the
\f[C].fmtypes\f[R] file.
.TP
--version
Show version information.
.TP
<DM>...
Front matter data modules to generate content for.
If no front matter type can be determined for a data module, it will be
ignored.
.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 <file>
Use an XML catalog when resolving entities.
Multiple catalogs may be loaded by specifying this option multiple
times.
.SS \f[C].fmtypes\f[R] file
.PP
This file specifies a list of info codes to associate with a particular
type of front matter.
.PP
Optionally, a path to an XSLT script can be given for each info code,
which will be used to generate the front matter instead of the built-in
XSLT.
The path to an XSLT script will be interpreted relative to the location
of the \f[C].fmtypes\f[R] file (typically, the top directory of the
CSDB).
The -D option can be used to dump the built-in XSLT for a type of front
matter as a starting point for a custom script.
.PP
Optionally, in the XML format, the attribute \f[C]ignoreDel\f[R] may be
specified to control whether deleted data modules and elements are
ignored when generating front matter contents.
These are data modules with an issue type of \[dq]\f[C]deleted\f[R]\[dq]
and elements with a change type of \[dq]\f[C]delete\f[R]\[dq].
A value of \[dq]\f[C]yes\f[R]\[dq] means deleted content will not be
included, while \[dq]\f[C]no\f[R]\[dq] means it will.
If this attribute is not specified, then a default value will be used
based on the type of front matter.
The following types will ignore deleted content by default:
.IP \[bu] 2
LOA
.IP \[bu] 2
LOASD
.IP \[bu] 2
LOI
.IP \[bu] 2
LOS
.IP \[bu] 2
LOTBL
.IP \[bu] 2
TOC
.IP \[bu] 2
TP
.PP
By default, the program will search for a file named \f[C].fmtypes\f[R]
in the current directory and parent directories, but any file can be
specified using the -F option.
.PP
Example of simple text format:
.IP
.nf
\f[C]
001 TP
005 LOA
006 LOT
007 LOS
009 TOC
00A LOA
00S LOEDM
00U HIGH fm/high.xsl
00V LOASD
00Z LOTBL
\f[R]
.fi
.PP
Example of XML format:
.IP
.nf
\f[C]
<fmtypes>
<fm infoCode=\[dq]001\[dq] type=\[dq]TP\[dq]/>
<fm infoCode=\[dq]005\[dq] type=\[dq]LOA\[dq]/>
<fm infoCode=\[dq]006\[dq] type=\[dq]LOT\[dq]/>
<fm infoCode=\[dq]007\[dq] type=\[dq]LOS\[dq]/>
<fm infoCode=\[dq]009\[dq] type=\[dq]TOC\[dq]/>
<fm infoCode=\[dq]00A\[dq] type=\[dq]LOI\[dq]/>
<fm infoCode=\[dq]00S\[dq] type=\[dq]LOEDM\[dq]/>
<fm infoCode=\[dq]00U\[dq] type=\[dq]HIGH\[dq] xsl=\[dq]fm/high.xsl\[dq]/>
<fm infoCode=\[dq]00V\[dq] type=\[dq]LOASD\[dq]/>
<fm infoCode=\[dq]00Z\[dq] type=\[dq]LOTBL\[dq]/>
</fmtypes>
\f[R]
.fi
.PP
The info code of each entry in the \f[C].fmtypes\f[R] file may also
include an info code variant.
This allows different transformations to be used based on the variant:
.IP
.nf
\f[C]
<fmtypes>
<fm infoCode=\[dq]00UA\[dq] type=\[dq]HIGH\[dq] xsl=\[dq]fm/high.xsl\[dq]/>
<fm infoCode=\[dq]00UB\[dq] type=\[dq]HIGH\[dq] xsl=\[dq]fm/high-updates.xsl\[dq]/>
<fm infoCode=\[dq]00U\[dq] type=\[dq]HIGH\[dq]/>
</fmtypes>
\f[R]
.fi
.PP
In the example above, a highlights data module (00U) with info code
variant A will use an XSL transformation that creates a simple
highlights, while a highlights data module with info code variant B will
use an XSL transformation that creates a highlights with update
instructions.
All other variants will use the built-in XSLT.
.PP
Entries are chosen in the order they are listed in the
\f[C].fmtypes\f[R] file.
An info code which does not specify a variant matches all possible
variants.
.SS Optional title page elements
.PP
When re-generating the front matter content for a title page data
module, optional elements which cannot be derived from the publication
module (such as the product illustration or bar code) will be copied
from the source data module when updating it.
.SS Multi-pass transforms
.PP
Rather than a literal XSLT file, the path specified for the
\f[C]xsl\f[R] attribute in the \f[C].fmtypes\f[R] file or the -x (--xsl)
option may be an XProc file which contains a pipeline with multiple
stylesheets.
This allows for multi-pass transformations.
.PP
Only a small subset of XProc is supported at this time.
.PP
Example:
.IP
.nf
\f[C]
<p:pipeline
xmlns:p=\[dq]http://www.w3.org/ns/xproc\[dq]
xmlns:xsl=\[dq]http://www.w3.org/1999/XSL/Transform\[dq]
version=\[dq]1.0\[dq]>
<p:xslt name=\[dq]Pass 1\[dq]>
<p:input port=\[dq]stylesheet\[dq]>
<p:document href=\[dq]pass1.xsl\[dq]/>
</p:input>
<p:with-param name=\[dq]update-instr\[dq] select=\[dq]true()\[dq]/>
</p:xslt>
<p:xslt name=\[dq]Pass 2\[dq]>
<p:input port=\[dq]stylesheet\[dq]>
<p:inline>
<xsl:transform version=\[dq]1.0\[dq]>
\&...
</xsl:transform>
</p:inline>
</p:input>
</p:xslt>
</p:pipeline>
\f[R]
.fi
.SH EXIT STATUS
.TP
0
No errors.
.TP
1
The date specified with -I is invalid.
.TP
2
No front matter types were specified.
.TP
3
An unknown front matter type was specified.
.TP
4
The resulting front matter content could not be merged in to a data
module.
.TP
5
The stylesheet specified for a type of front matter was invalid.
.SH EXAMPLE
.PP
Generate the content for a title page front matter data module and
overwrite the file:
.IP
.nf
\f[C]
$ s1kd-flatten PMC-EX-12345-00001-00_001-00_EN-CA.XML |
> s1kd-fmgen -f DMC-EX-A-00-00-00-00A-001A-D_001-00_EN-CA.XML
\f[R]
.fi
.SH AUTHORS
khzae.net.
gopher://khzae.net/0/s1kd/s1kd-tools/src/tools/s1kd-fmgen/doc/s1kd-fmgen.1