Base Converter¶
Bas class of all converters.
- class benker.converters.base_converter.BaseConverter¶
Bases:
object
Bas class of all converters.
- builder_cls¶
- convert_file(src_xml, dst_xml, **options)¶
Convert the tables from one format to another.
- 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.
OOXML parser options:
styles_path
(default:None
):Path to the stylesheet to use to resole table styles. In an uncompressed
.docx
tree structure, the stylesheet path isword/styles.xml
.
Common builder options: (none)
CALS builder options:
width_unit
(default: “mm”):Unit to use for column widths. Possible values are: ‘cm’, ‘dm’, ‘ft’, ‘in’, ‘m’, ‘mm’, ‘pc’, ‘pt’, ‘px’.
table_in_tgroup
(default:False
):Where should we put the table properties:
False
to insert the attributes@colsep
,@rowsep
, and@tabstyle
in the<table>
element,True
to insert the attributes@colsep
,@rowsep
, and@tgroupstyle
in the<tgroup>
element.
Formex4 builder options: (none)
- parser_cls¶