CALS to Formex 4 converter¶
New in version 0.5.0.
-
class
benker.converters.cals2formex.Cals2FormexConverter¶ Bases:
benker.converters.base_converter.BaseConverterCALS to Formex 4 converter
-
builder_cls¶ alias of
benker.builders.formex.FormexBuilder
-
parser_cls¶ alias of
benker.parsers.cals.CalsParser
-
-
benker.converters.cals2formex.convert_cals2formex(src_xml, dst_xml, **options)¶ Convert CALS 4 tables to Formex tables.
Parameters: - src_xml (str) – Source path of the XML file to convert.
- dst_xml (str) – Destination path of the XML file to produce.
- options –
Dictionary of parsing/building options.
Common parsing options:
encoding(default: “utf-8”):- XML encoding of the destination file.
CALS parser options:
cals_ns(defaultNone):- Namespace to use for CALS elements and attributes parsing.
Set
None(or “”) if you don’t use namespace in your XML. width_unit(default: “mm”):- Unit to use for table/column widths. Possible values are: ‘cm’, ‘dm’, ‘ft’, ‘in’, ‘m’, ‘mm’, ‘pc’, ‘pt’, ‘px’.
Formex 4 builder options:
use_cals(default:False):- Generate additional CALS-like elements and attributes to simplify the layout of Formex document in typesetting systems.
cals_ns(default: “https://lib.benker.com/schemas/cals.xsd”):- Namespace to use for CALS-like elements and attributes (requires:
use_cals). SetNone(or “”) if you don’t want to use namespace. cals_prefix(default: “cals”):- Namespace prefix to use for CALS-like elements and attributes (requires:
use_cals). width_unit(default: “mm”):- Unit to use for table/column widths (requires:
use_cals). Possible values are: ‘cm’, ‘dm’, ‘ft’, ‘in’, ‘m’, ‘mm’, ‘pc’, ‘pt’, ‘px’.