Synopsis of XML files stored in the archives supported by OpenTBS.
Version 2013-01-08
Extensions: odt, odg, ods, odf, odp, docx, xlsx and pptx
This file is incomplete, feel free to send your own comments to:
http://www.tinybutstrong.com/onlyyou.html
=================================
OpenOffice Documents (.ODT, .ODS, .ODG, .ODF, .ODP, .ODM)
and
LibreOffice Documents
=================================
All simple quotes "'" in texts are coded with "'" but they are automatically replaced by the OpenTBS plugin.
The main information is stored in the file 'content.xml'.
The pictures are stored in the directory 'Pictures' and should be registered into the file 'META-INF/manifest.xml'. (OpenTBS does it automatically for you when you use parameter "addpic")
Since OpenOffice 3.2, if a picture is not registered in the Manifest file, then it can produce a message error when opening the document.
Video and sound cannot be stored in OpenOffice documents.
Main file: "content.xml":
-------------------------
Synopsis:
---------
...
Normal new lines are made with a new paragraphs ...
Simple new lines are made with
Tabs are made with
Page-breaks are made with a new paragraph having a style which has the attribute fo:break-before="page" or fo:break-after="page".
Note that the page-break does not work if the attribute is in the paragraph element. A "break-before" at the first page, or a "break-after" on the last page has no effect.
Local styles (bold, color,...) are made with ...
... A paragraph typed as Header
... A list of items
... A table
Sections:
---------
...
...
...
...
Slides in a presentation
Table in a document:
--------------------
...
...
...
Comments:
---------
Comments in ODS workbooks (OpenOffice Calc):
...
2011-02-02T00:00:00
Here is my comment.
3,60
...
Comments in ODT documents (OpenOffice Write):
Here is the start of the text and now
Skrol29
2011-02-02T16:13:58.42
Here is my comment.
comment is just inserted there.
Headers and footers in a document:
----------------------------------
Header's and footer's contents are saved in the "sytles.xml" file:
You can choose for each page to hide or display the header and footer. Nevertheless, the contents is always the same for each page.
here is the header
here is the footer
Charts:
-------
The location of the chart is defined in the main subfile "contents.xml":
My title
My description
An image preview is saved in the file "ObjectReplacements/Object 1", and this image will be displayed
automatically instead of the real Chart view until the chart is manually changed in the document.
In order to avoid this preview, the followings must be deteled :
- the file "ObjectReplacements/Object 1",
- the reference in the "contents.xml" file,
- the reference in the "META-INF/manifest.xml" file.
Data and properties of the chart are saved into the corresponding subdirectory "Object 1".
Data are saved in "Object 1/contents.xml" in a table that groups data of all series of the chart.
column 1
column 2
column 3
ligne 1
9.1
3.2
4.54
ligne 2
2.4
8.8
9.65
ligne 3
3.1
1.5
3.7
ligne 4
4.3
9.02
6.2
Textboxes
---------
Message in a textbox
Usual text
Special to .ODF (OpenOffice Math Formula):
------------------------------------------
Any comment in the formula must be entered between text delimiters which are the double quotes (").
Newlines are made with the keyword 'newline' outside the text delimiter.
Pictures/Images:
----------------
Binary contents is saved as a file in "Pictures/"
Short synopsis of the control in the document:
=================================
Ms Office Document (.DOCX, .XLSX, .PPTX)
=================================
************************
Ms Word Document (.DOCX)
************************
The main file is usually "word/document.xml", but its actual location is defined in the file "[Content_Types].xml", in the element:
Note: I've test to change the "word/document.xml" name in both the "[Content_Types].xml" file and the archive, but this makes
Word 2010 to be unable to open the document, saying it is corrupted.
Synopsis of the main file "word/document.xml":
----------------------------------------------
// New paragraph
// Parameters of the paragraph
... // Set of parameters for a Run
// Start a new section. Sections are a set of page layout (margin, columns, ...) available until the next section.
// May be present whe the section is defined manually.
// Page break before the paragraph (way #1)
// New run item. A run item is a set of content having common layout properties.
Set of parameters for a Run. Examples: is italic, is bold.
Your text is here
// Simple new lines are made with
// Page breaks can also be made with (way #2)
// Tabs are placed between elements.
Next text // spaces between entities are dealt using attribute xml:space="preserve"
What are attributes "w:rsidR" and "w:rsidRPr" for?
--------------------------------------------------
"w:rsidR" is a Revision ID. Each new user on a doc has a new id,
and each of its modification is marked with its RsID.
More info: http://blogs.msdn.com/brian_jones/archive/2006/12/11/what-s-up-with-all-those-rsids.aspx
Synopsis of a table inserted in a Word document:
------------------------------------------------
...
// principally define colmun widths
...
...
...
...
Headers and footers:
--------------------
The headers and footers files are usually "/word/header1.xml" and "/word/footer1.xml".
They exists only if header/footer is defined.
There alos may have an optional couple of XML files for odd numbered pages (usually "/word/header2.xml" and "/word/footer2.xml").
And an optional couple of files for the first page (usually "/word/header3.xml" and "/word/footer3.xml").
The actual type and locations of Headers and Footers are defined in the main document "/word/document.xml"
Close to the bottom of it may have :
...
The information related to r:id are stored in the file "/word/_rels/document.xml.rels"
...
Locations are also appering in the file "[Content_Types].xml", in the elements like:
and
Some referenced header/footers may have no actual files because of no data.
Example of header source:
here is the text of the header
Comments, footnotes and endnotes:
------------------------------------
Like headers and footers, they are aslo saved in separated XML files.
Bookmarks:
----------
Here is a
bookmark
.
Textboxes:
----------
...
...
Here s a text box.
Charts:
-------
The first chart is saved under "word/charts/chart1.xml", and so on for the next ones.
The XML file of the chart contains a copy of the data used for the chart.
If the chart is designed manually, then "chart1.xml" also contains references to cells of an Ms Excel files that is used by Ms Word for managing series.
The Excel file is emmbeded in the Docx file, for exemple: "word/embeddings/Worksheet_Microsoft_Excel1.xlsx"
The path of the Excel file is saved into "word/charts/_rels/chart1.xml.rels".
Nevertheless the references to that Exvel file are optional and can be deleted from the XML of the chart.
Title of the chart, the axes and the series are saved in "chart1.xml".
Other custom text boxes are saved in a shape file. For example : "word/drawings/drawing1.xml"
Example of a series saved in the XML (the tags are different for an XY series):
Sheet1!$A$2
Here is the name of the Series
Sheet1!$B$1:$E$1
Category A
Category B
Category C
Category D
Sheet1!$B$2:$E$2
General
20.399999999999999
27.4
90
20.399999999999999
****************************
Ms Excel SpreadSheet (.XLSX)
****************************
An Excel workbook can have one or several worksheets. The contents of cells are saved in worksheets.
Worksheets files are named 'xl/worksheets/sheet1.xml', and also sheet2.xml, sheet3.xml...
The file names are not the names defined in Excel by the user, they are internal names. But it seems
that there is always at least a worksheet named 'sheet1.xml'.
All string values of cells are stored in the file 'xl/sharedStrings.xml'. The cells contains
in fact the index of the string in the sharedStrings.xml file. This separation will probably
make difficulties to merge an Excel sheet.
All sheets of the workbook are listed in the file "xl/workbook.xml".
Synopsis of a sheet file like "xl/worksheets/sheet1.xml":
---------------------------------------------------------
...
// A range of one row in wich several cells are defined
/* Definition of a cell:
* Attribute r is the address if the cell in the sheet (format A1). This attribute is optional.
* Attribute s is the style of the cell (the format). Styles are saved into the file 'xl/styles.xml' but I have not found the link yet.
* Attribute t is the type of data, by default it is numerical
* t="s" means that the displayed value is a string, the saved value is the index if the string taken in file sharedStrings.xml.
*/
B13+B14 //the formula. If there is no formula, this tag is absent.
0 //the inner value without formatting. If t="s" then the value is in fact the index of the string in the "xl/sharedStrings.xml" file.
Synopsis of the Shared String file "xl/sharedStrings.xml":
----------------------------------------------------------
value or text
**********************************
Ms PowerPoint Presentation (.PPTX)
**********************************
Think to set all texts to "Tools\Language\No check" when you edit the PowerPoint presentation, otherwise some TBS fields
can be split by XML tags about the language and spell checking.
Slides are listed in the file 'ppt/_rels/presentation.xml.rels', where an internal id is affected to them.
The first slide is quite always corresponding to the file 'ppt/slides/slide1.xml'.
Synopsis of a slide file like "ppt/slides/slide1.xml":
------------------------------------------------------
Some text here
***************
Pictures/Images
***************
Binary contents is saved as a file in "word/media/" , "ppt/media/" , "xl/media/"
Word :
======
image link saved into "word/_rels/document.xml.rels":
They are two ways to insert a picture.
1) VML: (old classic way)
-------------------------
(short synopsis)
...
// this element contains the size of the picture
// this element contains the link to the picture internal file
2) DrawingML: (the new way that includes 2D/3D effects)
-------------------------------------------------------
(short synopsis)
// this element gives the size of the shape box that contains the picture
// this optional element gives the description and title of the image
// this optional element gives the URL and tooltip of the link if any. In Word 2007 you cannot customize the title and desciption
// this element contains the link to the picture internal file
// this element gives the size of the picture inside its shape box, it can be rescaled to fit in the shape box
Powerpoint:
===========
(short synopsis)
// this optional element gives the description and title of the image
Excel:
======
The presence of pictures in the sheet is mentioned with a single entity at the bottom of the entity.
The entity has a reference to the file of all Rels of the sheet.
All pictures of a sheet are finally references in a third XML file.
* File "xl\worksheets\sheet1.xml"
...
(only one entity for all pictures in the sheet)
* File "xl\worksheets\_rels\sheet1.xml.rels"
(only one entity for all pictures in the sheet)
* File "xl\drawings\drawing1.xml"
(short synopsis, one entity per picture in the sheet)