View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Martin Hosken > SIL-Shoe-1.37 > SIL::Shoe::Backend::openoffice



Annotate this POD


New  2
Open  0
View/Report Bugs
Module Version: 0.3   Source  


shlex openoffice backend - puts shlex output into opendocument 1.0 format


  shlex -c config.xml [-o outfile] [-s style_info] -b openoffice infile


  -o outfile     This is the base name on which the output filenames are based
  -s style_info  An Opendocument file that contains a specially named "section"
upon which the dictionary sections are based


the <backend> section

In the config.xml file, you have have a <backend> tag. This can contain several <property> tags with corresponding values.

The properties that the backend looks for are:


a value of one will give verbose openoffice backend debugging information.


a value of one will cause the backend to create a separate file for each section (eg. one for the main dictionary, and one for each index)


this will create the contents of the style as a variable of the same name. The text will be visible. This is useful for creating a first and last word in the header and footer of a page. The value is a list of styles, separated by commas.


this will create a reference where the reference name is the contents of that style. After the style is printed, the reference will be added immediate afterwards (but this reference will not be visible). This can be used for page numbers of a letter or particular word or place. The value is a list of styles, separated by commas.


if the value is 2, it will create double columns in each section for each letter. Otherwise single columns will be used. This will allow for a letter header that spans the whole page, but has all the entries in double columns. It is much better, however, to create a double column style and pass it in as a style sheet using the -s flag.

For example:

  <backend type="openoffice">
      <property name="debug" value="1"/>
      <property name="styles_as_variable" value="Lexeme,Letter,IndexEng" />
      <property name="styles_as_reference" value="IndexEng" />
      <property name="split_files" value="1" />
      <property name="columns" value="2" />

Section Styles

Because Openoffice does not allow you to edit a stylesheet used for sections, a sample must be passed in, and that section's style will be used for all the sections of that type.

To pass in a double column style, create a style document that is passed in with the -s flag. Here is how it works:

Each major section in the configuation file has a type and a name. Each section will have a name of "section_" followed by the type followed by the name, and then a number.

If a section is called <section type="dictionary" name="main" keys="lx hm" >

then the openoffice section names will be section_dictionary_main_0 section_dictionary_main_1 section_dictionary_main_2 etc.

or for <section type="index" name="eng" keys="reEng" >

they would be named: section_index_eng_0 section_index_eng_1 section_index_eng_2

If you create a document that has a section named section_dictionary_main and this is given as a stylesheet using the -s flag, shlex will take the style from this section and use it for all the sections (_0, _1, etc) with that name.

You can also just look at the section names in your openoffice document (Choose Format then Sections from the Menu) to know what they are called, and create a section without the _0 at the end and it will use that style.

For exampel, you can put these sections section_index_eng and section_dictionary_main into a document such as SectionStyles.odt (having sample text and entries in this document is fine - the content will be ignored), and then run shlex with this document as the argument of the -s flag:

  shlex -c configure.xml -o MyDict -b openoffice -s SectionStyles.odt database.db
syntax highlighting: