Synopsis of XML files stored in the archives supported by OpenTBS.
Version 2010-01-18

Extensions:  odt, odg, ods, odf, odp, docx, xlsx and pptx

This file is uncomplete, feel free to send your own comments to:
  http://www.tinybutstrong.com/onlyyou.html

=================================
OpenOffice Writer Document (.ODT)
=================================

All simple quotes "'" in texts are coded with "&apos;" but they are automatically replaced by the OpenTBS plugin.

File: 'content.xml':
-----------------------

<office:document-content>
	...
  <office:body>
  	<office:text>
  		<text:section text:style-name="Sect1" text:name="Section1">
  			<text:p text:style-name="Standard">
  				Normal new lines are made new paragraphs <text:p>...</text:p>
  				Simple new lines are made with <text:line-break/>
  				Page breaks are made with a new paragraphe having a style which has the attribute fo:break-before="page". 
  				Local styles (bold, color,...) are made with <text:span text:style-name="T1">...</text:span>
  				Images:
					<draw:frame draw:style-name="fr1" draw:name="images1" text:anchor-type="paragraph" svg:width="0.847cm" svg:height="0.847cm" draw:z-index="0">
						<draw:image xlink:href="Pictures/100000000000002000000020A0D29467.jpg" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/>
					</draw:frame>
  			</text:p>
  		</text:section>
  	</office:text>
  </office:body>
</office:document-content>

Table:
-------
<table:table>
	<table:table-column ... />
	<table:table-row>
		<table:table-cell> ... </table:table-cell>
		<table:table-cell> ... </table:table-cell>
		...
	</table:table-row>
</table:table>


=================================
OpenOffice Calc Spreadsheet (.ODS)
=================================

File: 'content.xml':

Same as table for ODT.

=================================
OpenOffice Draw Graphic (.ODG)
=================================

File: 'content.xml':

=================================
OpenOffice Math Formula (.ODF)
=================================

File: 'content.xml':

Any comment in the formula must be entered between text dilimitors which is the double quotes (").
Newlines are made with the keyword 'newline' outside the text delimitor. 

=====================================
OpenOffice Impress Presentation (.ODP)
=====================================

File: 'content.xml':

=================================
Ms Word 2007 Document (.DOCX)
=================================
File: 'word/document.xml':

<w:document>
	<w:body>

		<w:p> New paragraph
      <w:pPr> Parameters of the paragraph
        <w:rPr> Set of parameters for a Run
        </w:rPr>
      </w:pPr>
			<w:r> New run item. A run item is a set of content having common layout properties.
        <w:rPr> Set of parameters for a Run. Examples: <w:i/> is italic, <w:b/> is bold.
        </w:rPr>
				<w:t>Your text is here</w:t>
				Simple new lines are made with <w:br/>
				Page breaks are made with <w:br w:type="page"/>
			</w:r>
		</w:p> 

	</w:body>
</w:document>

-> 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

Table in a document:
--------------------
<w:p>...</w:p>

<w:tbl>
	<w:tblPr></w:tblPr>
	<w:tblGrid></w:tblGrid>
	<w:tr>
		<w:tc> ... </w:tc>
		<w:tc> ... </w:tc>
		...
	</w:tr>
</w:tbl>

<w:p>...</w:p> 

=================================
Ms Excel 2007 SpreadSheet (.XLSX)
=================================

The contents of cells are saved in the files 'xl/worksheets/sheet1.xml', sheet2.xml, sheet3.xml...
sheet1, sheet2, sheet3 are not the displays name of the sheets but the internal name. It seems that
there is always a 'sheet1.xml' file.

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 2007 sheet. 

File: 'xl/workbook.xml'

File: 'xl/worksheets/sheet1.xml':
<worksheet>
	...
	<sheetData>
		<row r="2" spans="2:2" ht="90">
			A range of one row in wich several cells are defined
			<c r="B2" s="1" t="s">
				
				Definition of a cell:
				Attribute r is the adress if the cell in the sheet
				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.
				<f>B13+B14</f> the formula. If there is no formula, this tag is absent.
				<v>0</v> the inner value without formating. If t="s" then the value is in fact the index of the string.
			</c>
		</row>
	</sheetData>
</worksheet>

File: 'xl/sharedStrings.xml'
<sst>
	<si>
		<t>value or text</t>
	</si>
</sst>

=======================================
Ms PowerPoint 2007 Presentation (.PPTX)
=======================================

Think to set all texts to "Tools\Language\No check". Otherwise some TBS fields can be splited by XML tags about the language and spell checking.

'ppt/slides/slide1.xml'

******
Images
******

ODF:
pic_path=Pictures/
pic_att=draw:image#xlink:href
magnet=draw:image (par dfaut), draw:frame, draw:text

<text:p text:style-name="P3">
	<draw:frame draw:style-name="fr1" draw:name="Cadre1" text:anchor-type="paragraph" svg:width="5.292cm" draw:z-index="0">
		<draw:text-box fo:min-height="5.821cm">
			<text:p text:style-name="Drawing">
				<draw:a xlink:type="simple" xlink:href="" office:name="images1 (toto nom url)">
					<draw:frame draw:style-name="fr2" draw:name="images1 (toto nom)" text:anchor-type="paragraph" svg:x="0cm" svg:y="0cm" svg:width="5.292cm" style:rel-width="100%" svg:height="5.821cm" style:rel-height="scale" draw:z-index="1">
						<draw:image xlink:href="Pictures/1000000000000096000000A5773AC4DD.png" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/>
						<svg:title>images1 (toto alternative)</svg:title>
					</draw:frame>
				</draw:a>Dessin <text:sequence text:ref-name="refDrawing0" text:name="Drawing" text:formula="ooow:Drawing+1" style:num-format="1">1</text:sequence>: toto <text:s/>légende</text:p>
			</draw:text-box>
		</draw:frame>
	</text:p>




Word :
pic_path=word/media/
pic_att=v:imagedata#r:id
       image link saved into "word/_rels/document.xml.rels"

<Relationship Id="rId6" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" Target="media/image1.png"/>

<w:pict>
	<v:shapetype id="_x0000_t75" coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f">
		<v:stroke joinstyle="miter"/>
		<v:formulas>
			<v:f eqn="if lineDrawn pixelLineWidth 0"/>
			...
		</v:formulas>
		<v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"/>
		<o:lock v:ext="edit" aspectratio="t"/>
	</v:shapetype>
	<v:shape id="_x0000_i1025" type="#_x0000_t75" alt="toto texte de remplacement" style="width:150pt;height:165pt">
		<v:imagedata r:id="rId6" o:title=""/>
	</v:shape>
</w:pict>



Ppt  : ppt/media/
Excel: xl/media/