OpenDocument in the Oracc System

OpenDocument is a powerful XML vocabulary which is an ISO international standard for describing all of the document types that make up an office suite. This document does not describe OpenDocument XML, but instead describes how the Oracc software can be used to create and style OpenDocument Text files. There is also a short, less technical overview here.

OpenDocument | Processing | Configuring | Style files | XML files | Automatic

OpenDocument

A sophisticated free software application, OpenOffice (NeoOffice on the Mac) uses the OpenDocument format, and the Oracc system is able to turn an extended form of ATF into Open Document XML, so that OpenOffice can be used to make PDFs or Word versions of anything from individual texts to entire books.

OpenDocument (OD) is an XML vocabulary which was developed by Oasis [http://www.oasis-open.org] and submitted to the ISO for ratification as an international standard. Both the Oasis version of the specification (in PDF format) and the ratified standard, ISO/iEC 26300:2006 (in XHTML format) are available online.

While the standards are large, and the specification admittedly has its trickier corners, OpenDocument is actually a fairly simple way of specifying text documents in XML (one reason the specifications are so large is that they cover spreadsheets, presentation software and other document types which are not normally germane to the Oracc system). At its core, an OpenDocument text is a collection of headings, sections, paragraphs and spans, any of which can be styled. A good introduction to OpenDocument is the book OpenDocument Essentials, which you can read online [http://books.evc-cit.info/] and also purchase in hard-copy. Chapters 3 and 4 of OpenDocument Essentials give a good introduction to the things most users will need to know to customize Oracc OpenDocument texts.

For everyday use, however, most users will find that the Oracc default settings, in combination with some project options will be all they need to make perfectly good printable versions of text editions, or to obtain versions of ATF transliterations which can be imported into OpenOffice or Word for use in preparing articles and books with traditional tools.

Processing

OD processing can be done directly on ATF files or on a file type we call CDF, or Oracc Document Format. The processing is done with a program which contains the ATF processor and adds routines to understand CDF commands. CDF is documented here [http://oracc.org/ns/CDF/1.0/].

Configuring

OD configuration is done via several mechanisms. The CDF processor automatically includes the project configuration file in the XML it generates where the options are then available to the scripts that do the final conversion into OpenDocument.

In addition, a special, simplified input form is available for OD styles. More complicated OD configuration is done with XML files which give configuration fragments to be read by the processor and embedded in its output in the appropriate places.

In all cases, projects can override the default Oracc OD configuration by providing their own versions of the files mentioned below. Project versions of files must be named according to the guidelines in each section, and all must be maintained in the project's 00lib/ directory.

Style files

Style files offer some simplification of OD rules for styling sections, headings, paragraphs, spans and tables.

The project style file is named project.sty. Here is an example, which comes from the RINAP project:

@style font "Times New Roman" svg:font-family="'Times New Roman'" 
       style:font-family-generic=roman style:font-pitch=variable

@style font UngkamBasic svg:font-family="Ungkam Book Basic"
       style:font-family-generic=roman style:font-pitch=variable

@style font Arial svg:font-family=Arial
       style:font-family-generic=swiss style:font-pitch=variable

@style font Arial1 svg:font-family=Arial
       style:font-family-generic=system style:font-pitch=variable

@style section introduction fo:column-count=1

@style paragraph introduction.p fo:text-align=justify
       fo:margin-left=2.54cm fo:margin-right=2.54cm fo:text-indent=0cm
       fo:widows=0 fo:orphans=0

@style section discussion fo:column-count=2 fo:column-gap=3mm

@style paragraph discussion.p fo:text-align=justify
       fo:text-indent=0cm
       fo:widows=0 fo:orphans=0 fo:font-size=10pt

@style section bibliography fo:column-count=2 fo:column-gap=3mm

@style paragraph bibliography.p fo:text-align=justify
       fo:text-indent=-1.2cm fo:margin-left=1.2cm
       fo:widows=0 fo:orphans=0 fo:font-size=8pt
       cdl:tab-stops="1.5cm left"

@style paragraph #default-style
       fo:hyphenation-ladder-count=no-limit style:text-autospace=ideograph-alpha
       style:punctuation-wrap=hanging style:line-break=strict
       style:tab-stop-distance=0.4925in style:writing-mode=page
       [text] style:use-window-font-color=true style:font-name=UngkamBasic
       fo:font-size=12p fo:language=en fo:country=US style:letter-kerning=true
       style:font-name-asian=Arial1 style:font-size-asian=10.5pt 
       style:language-asian=zxx style:country-asian=zxx
       style:font-name-complex=Arial1 style:font-size-complex=12pt
       style:language-complex=zxx style:country-complex=none fo:hyphenate=false
       fo:hyphenation-remain-char-count=2 fo:hyphenation-push-char-count=2

@style paragraph Standard style:class=text

@style paragraph H.atftext fo:font-size=14pt fo:font-style=normal fo:font-weight=bold

@style paragraph H.surface fo:font-size=14pt fo:font-style=normal fo:font-weight=bold

@style paragraph H.column  fo:font-size=13pt fo:font-style=normal fo:font-weight=bold

@style paragraph H.title   fo:text-align=center 
       fo:font-size=14pt fo:font-style=normal fo:font-weight=bold

@style paragraph h1   fo:text-align=center 
       fo:font-size=14pt fo:font-style=normal fo:font-weight=bold

@style paragraph h2   fo:text-align=center 
       fo:font-size=12pt fo:font-style=normal fo:font-weight=bold

@style table     #default-style table:border-model=collapsing

@style table-row #default-style fo:keep-together=auto

@style table-column Col-lineno style:column-width=1cm

@style table-column Col style:column-width=6cm

@style page-layout #default-page-layout style:layout-grid-square-mode=false

@style text akk	   	fo:font-style=italic

@style text compound	fo:font-size=10pt

@style text elx	   	fo:font-style=italic

@style text flags	fo:font-style=normal style:text-position="super 70%"

@style text i		fo:font-style=italic

@style text sac-sign	fo:font-size=10pt

@style text sub		style:text-position="sub 70%"

@style text sup		style:text-position="super 70%"

@style text supsub	style:text-position="22% 50%"

@style text supsup	style:text-position="40% 50%"

@style text sux	   	fo:font-style=normal

XML files

XML configuration files give users direct control over OD features which are not accessible through the style files. Note that it is also possible to use OpenOffice as a graphical front end for managing these features, but the XML configuration file strategy allows production of complex documents like books to be completely automated.

Masters

The masters configuration file is named master-styles.xml and provides the office:master-styles section of an OD text in its entirety--the file is copied directly into the output without being changed, and must therefore contain all of the code necessary for the office:master-styles section. The default version of this file defines page masters for various formats and purposes. The project version is also named master-styles.xml. Here is an example, again from the RINAP project:

<office:master-styles
      xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
      xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" 
      xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
      xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"      
      style:name="Standard"> 
  <style:master-page 
      style:name="Standard" 
      style:page-master-name="pm1" /> 
  <style:master-page style:name="LandscapePage" 
		     style:page-master-name="pm2" 
		     style:next-style-name="Standard"> 
    <style:header> 
      <text:p text:style-name="P1">page header</text:p> 
    </style:header> 
    <style:footer> 
      <text:p text:style-name="P2">page footer</text:p> 
    </style:footer> 
  </style:master-page> 
</office:master-styles> 

Automatic

Another XML configuration file contains data which is integrated into the office:automatic-styles section of the OD text file. This differs from the master-styles configuration because office:automatic-styles contains a lot of information from varying sources, including that derived from the style file. This means that the automatic-styles configuration file gives only a fragment of the automatic-styles data. The structure of the file reflects this: it does not have an official office:automatic-styles top-level node, but one named simply wrapper. This node serves as a host for the namespaces, but is otherwise discarded. The child-nodes of the top-level wrapper are copied verbatim into the office:automatic-styles section of the document.

The RINAP version of this file looks like this:

<wrapper
      xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
      xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
      xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0">
  <style:page-layout 
      style:name="pm2"> 
    <style:page-layout-properties 
	fo:page-width="8.5in" fo:page-height="11in" 
	style:num-format="1" 
	style:print-orientation="portrait" 
	fo:margin-top="1in" fo:margin-bottom="1in" 
	fo:margin-left="1in" fo:margin-right="1in" 
	style:writing-mode="lr-tb" 
	style:footnote-max-height="1in">
      <style:footnote-sep style:width="0.0071in" 
			  style:distance-before-sep="0.0398in" 
			  style:distance-after-sep="0.0398in" 
			  style:adjustment="left" 
			  style:rel-width="25%" 
			  style:color="#000000"/> 
    </style:page-layout-properties> 
    <style:header-style> 
      <style:header-footer-properties 
	  fo:min-height="0in" fo:margin-bottom="0.1965in"/> 
    </style:header-style> 
    <style:footer-style> 
      <style:header-footer-properties
	  fo:min-height="0in" fo:margin-top="0.1965in"/>
    </style:footer-style>
  </style:page-layout>
</wrapper>
18 Dec 2019 osc at oracc dot org

Steve Tinney

Steve Tinney, 'OpenDocument in the Oracc System', Oracc: The Open Richly Annotated Cuneiform Corpus, Oracc, 2019 [http://oracc.museum.upenn.edu/doc/about/standards/opendoc/]

 
Back to top ^^
 

Released under a Creative Commons Attribution Share-Alike license 3.0, 2014. [http://www.facebook.com/opencuneiform] [http://oracc.blogspot.com] [http://www.twitter.com/oracctivity]
Oracc uses cookies only to collect Google Analytics data. Read more here; see the stats here [http://www.seethestats.com/site/oracc.museum.upenn.edu]; opt out here.

http://oracc.museum.upenn.edu/doc/about/standards/opendoc/