odf.odf2xhtml.ODF2XHTML Class Reference

The ODF2XHTML parses an ODF file and produces XHTML. More...

Inheritance diagram for odf.odf2xhtml.ODF2XHTML:
[legend]
Collaboration diagram for odf.odf2xhtml.ODF2XHTML:
[legend]

## Public Member Functions

def | __init__ (self, generate_css=True, embedable=False)
def | set_plain (self)
| Tell the parser to not generate CSS. More...
def | set_embedable (self)
| Tells the converter to only output the parts inside the <body> More...
def | add_style_file (self, stylefilename, media=None)
| Add a link to an external style file. More...
def | writeout (self, s)
def | writedata (self)
def | opentag (self, tag, attrs={}, block=False)
| Create an open HTML tag. More...
def | closetag (self, tag, block=True)
| Close an open HTML tag. More...
def | emptytag (self, tag, attrs={})
def | characters (self, data)
def | startElementNS (self, tag, qname, attrs)
def | endElementNS (self, tag, qname)
def | handle_starttag (self, tag, method, attrs)
def | handle_endtag (self, tag, attrs, method)
def | unknown_starttag (self, tag, attrs)
def | unknown_endtag (self, tag, attrs)
def | s_ignorexml (self, tag, attrs)
| Ignore this xml element and all children of it It will automatically stop ignoring. More...
def | s_ignorecont (self, tag, attrs)
| Stop processing the text nodes. More...
def | s_processcont (self, tag, attrs)
| Start processing the text nodes. More...
def | classname (self, attrs)
| Generate a class name from a style name. More...
def | get_anchor (self, name)
| Create a unique anchor id for a href name. More...
def | purgedata (self)
def | e_dc_title (self, tag, attrs)
| Get the title from the meta data and create a HTML <title> More...
def | e_dc_metatag (self, tag, attrs)
| Any other meta data is added as a <meta> element. More...
def | e_dc_contentlanguage (self, tag, attrs)
| Set the content language. More...
def | e_dc_creator (self, tag, attrs)
| Set the content creator. More...
def | s_custom_shape (self, tag, attrs)
| A <draw:custom-shape> is made into a in HTML which is then styled. More...
def | e_custom_shape (self, tag, attrs)
| End the <draw:frame> More...
def | s_draw_frame (self, tag, attrs)
| A <draw:frame> is made into a in HTML which is then styled. More...
def | e_draw_frame (self, tag, attrs)
| End the <draw:frame> More...
def | s_draw_fill_image (self, tag, attrs)
def | rewritelink (self, imghref)
| Intended to be overloaded if you don't store your pictures in a Pictures subfolder. More...
def | s_draw_image (self, tag, attrs)
| A <draw:image> becomes an element. More...
def | s_draw_object (self, tag, attrs)
| A <draw:object> is embedded object in the document (e.g. More...
def | s_draw_object_ole (self, tag, attrs)
| A <draw:object-ole> is embedded OLE object in the document (e.g. More...
def | s_draw_page (self, tag, attrs)
| A <draw:page> is a slide in a presentation. More...
def | e_draw_page (self, tag, attrs)
def | s_draw_textbox (self, tag, attrs)
def | e_draw_textbox (self, tag, attrs)
| End the <draw:text-box> More...
def | html_body (self, tag, attrs)
def | generate_stylesheet (self)
def | generate_footnotes (self)
def | s_office_automatic_styles (self, tag, attrs)
def | s_office_document_content (self, tag, attrs)
| First tag in the content.xml file. More...
def | e_office_document_content (self, tag, attrs)
| Last tag. More...
def | s_office_master_styles (self, tag, attrs)
def | s_office_presentation (self, tag, attrs)
| For some odd reason, OpenOffice Impress doesn't define a default-style for the 'paragraph'. More...
def | e_office_presentation (self, tag, attrs)
def | s_office_spreadsheet (self, tag, attrs)
def | e_office_spreadsheet (self, tag, attrs)
def | s_office_styles (self, tag, attrs)
def | s_office_text (self, tag, attrs)
| OpenDocument text. More...
def | e_office_text (self, tag, attrs)
def | s_style_handle_properties (self, tag, attrs)
| Copy all attributes to a struct. More...
def | s_style_default_style (self, tag, attrs)
| A default style is like a style on an HTML tag. More...
def | e_style_default_style (self, tag, attrs)
def | s_style_font_face (self, tag, attrs)
| It is possible that the HTML browser doesn't know how to show a particular font. More...
def | s_style_footer (self, tag, attrs)
def | e_style_footer (self, tag, attrs)
def | s_style_footer_style (self, tag, attrs)
def | s_style_header (self, tag, attrs)
def | e_style_header (self, tag, attrs)
def | s_style_header_style (self, tag, attrs)
def | s_style_default_page_layout (self, tag, attrs)
| Collect the formatting for the default page layout style. More...
def | s_style_page_layout (self, tag, attrs)
| Collect the formatting for the page layout style. More...
def | e_style_page_layout (self, tag, attrs)
| End this style. More...
def | s_style_master_page (self, tag, attrs)
| Collect the formatting for the page layout style. More...
def | s_style_style (self, tag, attrs)
| Collect the formatting for the style. More...
def | e_style_style (self, tag, attrs)
| End this style. More...
def | s_table_table (self, tag, attrs)
| Start a table. More...
def | e_table_table (self, tag, attrs)
| End a table. More...
def | s_table_table_cell (self, tag, attrs)
| Start a table cell. More...
def | e_table_table_cell (self, tag, attrs)
| End a table cell. More...
def | s_table_table_column (self, tag, attrs)
| Start a table column. More...
def | s_table_table_row (self, tag, attrs)
| Start a table row. More...
def | e_table_table_row (self, tag, attrs)
| End a table row. More...
def | s_text_a (self, tag, attrs)
| Anchors start. More...
def | e_text_a (self, tag, attrs)
| End an anchor or bookmark reference. More...
def | s_text_bookmark (self, tag, attrs)
| Bookmark definition. More...
def | s_text_bookmark_ref (self, tag, attrs)
| Bookmark reference. More...
def | s_text_h (self, tag, attrs)
| Headings start. More...
def | e_text_h (self, tag, attrs)
| Headings end Side-effect: If there is no title in the metadata, then it is taken from the first heading of any level. More...
def | s_text_line_break (self, tag, attrs)
| Force a line break ( ) More...
def | s_text_list (self, tag, attrs)
| Start a list (. More...
def | e_text_list (self, tag, attrs)
| End a list. More...
def | s_text_list_item (self, tag, attrs)
| Start list item. More...
def | e_text_list_item (self, tag, attrs)
| End list item. More...
def | s_text_list_level_style_bullet (self, tag, attrs)
| CSS doesn't have the ability to set the glyph to a particular character, so we just go through the available glyphs. More...
def | e_text_list_level_style_bullet (self, tag, attrs)
def | s_text_list_level_style_number (self, tag, attrs)
def | e_text_list_level_style_number (self, tag, attrs)
def | s_text_note (self, tag, attrs)
def | e_text_note (self, tag, attrs)
def | collectnote (self, s)
def | s_text_note_body (self, tag, attrs)
def | e_text_note_body (self, tag, attrs)
def | e_text_note_citation (self, tag, attrs)
def | s_text_p (self, tag, attrs)
| Paragraph. More...
def | e_text_p (self, tag, attrs)
| End Paragraph. More...
def | s_text_s (self, tag, attrs)
| Generate a number of spaces. More...
def | s_text_span (self, tag, attrs)
| The <text:span> element matches the element in HTML. More...
def | e_text_span (self, tag, attrs)
| End the <text:span> More...
def | s_text_tab (self, tag, attrs)
| Move to the next tabstop. More...
def | s_text_x_source (self, tag, attrs)
| Various indexes and tables of contents. More...
def | e_text_x_source (self, tag, attrs)
| Various indexes and tables of contents. More...
def | load (self, odffile)
| Loads a document into the parser and parses it. More...
def | odf2xhtml (self, odffile)
| Load a file and return the XHTML. More...
def | xhtml (self)
| Returns the xhtml. More...
def | css (self)
| Returns the CSS content. More...
def | save (self, outputfile, addsuffix=False)
| Save the HTML under the filename. More...

## Public Attributes

| generate_css
| elements
| use_internal_css
| stylefilename
| notedict
| currentnote
| notebody
| lines
| xmlfile
| title
| language
| creator
| data
| tagstack
| htmlstack
| pstack
| processelem
| processcont
| listtypes
| headinglevels
| cs
| anchors
| stylestack
| styledict
| currentstyle
| metatags
| autoprefix
| prevstyle
| document

## Static Public Attributes

string | default_styles
dictionary | familymap

## Detailed Description

The ODF2XHTML parses an ODF file and produces XHTML.

Definition at line 362 of file odf2xhtml.py.

## Constructor & Destructor Documentation

## __init__()

def odf.odf2xhtml.ODF2XHTML.__init__ | ( |  | self,
|  |  | generate_css = `True`,
|  |  | embedable = `False`
| ) |  |

Definition at line 364 of file odf2xhtml.py.

## Member Function Documentation

## add_style_file()

def odf.odf2xhtml.ODF2XHTML.add_style_file | ( |  | self,
|  |  | stylefilename,
|  |  | media = `None`
| ) |  |

Add a link to an external style file.

Also turns of the embedding of styles in the HTML

Definition at line 485 of file odf2xhtml.py.

## characters()

def odf.odf2xhtml.ODF2XHTML.characters | ( |  | self,
|  |  | data
| ) |  |

Definition at line 569 of file odf2xhtml.py.

## classname()

def odf.odf2xhtml.ODF2XHTML.classname | ( |  | self,
|  |  | attrs
| ) |  |

Generate a class name from a style name.

Definition at line 625 of file odf2xhtml.py.

Here is the caller graph for this function:

## closetag()

def odf.odf2xhtml.ODF2XHTML.closetag | ( |  | self,
|  |  | tag,
|  |  | block = `True`
| ) |  |

Close an open HTML tag.

Definition at line 554 of file odf2xhtml.py.

Here is the call graph for this function:
Here is the caller graph for this function:

## collectnote()

def odf.odf2xhtml.ODF2XHTML.collectnote | ( |  | self,
|  |  | s
| ) |  |

Definition at line 1395 of file odf2xhtml.py.

Here is the caller graph for this function:

## css()

def odf.odf2xhtml.ODF2XHTML.css | ( |  | self | ) |

Returns the CSS content.

Definition at line 1583 of file odf2xhtml.py.

Here is the call graph for this function:

## e_custom_shape()

def odf.odf2xhtml.ODF2XHTML.e_custom_shape | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

End the <draw:frame>

Definition at line 714 of file odf2xhtml.py.

Here is the call graph for this function:

## e_dc_contentlanguage()

def odf.odf2xhtml.ODF2XHTML.e_dc_contentlanguage | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Set the content language.

Identifies the targeted audience

Definition at line 666 of file odf2xhtml.py.

## e_dc_creator()

def odf.odf2xhtml.ODF2XHTML.e_dc_creator | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Set the content creator.

Identifies the targeted audience

Definition at line 674 of file odf2xhtml.py.

## e_dc_metatag()

def odf.odf2xhtml.ODF2XHTML.e_dc_metatag | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Any other meta data is added as a <meta> element.

Definition at line 659 of file odf2xhtml.py.

## e_dc_title()

def odf.odf2xhtml.ODF2XHTML.e_dc_title | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Get the title from the meta data and create a HTML <title>

Definition at line 651 of file odf2xhtml.py.

## e_draw_frame()

def odf.odf2xhtml.ODF2XHTML.e_draw_frame | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

End the <draw:frame>

Definition at line 752 of file odf2xhtml.py.

Here is the call graph for this function:

## e_draw_page()

def odf.odf2xhtml.ODF2XHTML.e_draw_page | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Definition at line 829 of file odf2xhtml.py.

Here is the call graph for this function:

## e_draw_textbox()

def odf.odf2xhtml.ODF2XHTML.e_draw_textbox | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

End the <draw:text-box>

Definition at line 842 of file odf2xhtml.py.

Here is the call graph for this function:

## e_office_document_content()

def odf.odf2xhtml.ODF2XHTML.e_office_document_content | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Last tag.

Definition at line 930 of file odf2xhtml.py.

Here is the call graph for this function:

## e_office_presentation()

def odf.odf2xhtml.ODF2XHTML.e_office_presentation | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Definition at line 947 of file odf2xhtml.py.

Here is the call graph for this function:

## e_office_spreadsheet()

def odf.odf2xhtml.ODF2XHTML.e_office_spreadsheet | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Definition at line 954 of file odf2xhtml.py.

Here is the call graph for this function:

## e_office_text()

def odf.odf2xhtml.ODF2XHTML.e_office_text | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Definition at line 967 of file odf2xhtml.py.

Here is the call graph for this function:

## e_style_default_style()

def odf.odf2xhtml.ODF2XHTML.e_style_default_style | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Definition at line 995 of file odf2xhtml.py.

## e_style_footer()

def odf.odf2xhtml.ODF2XHTML.e_style_footer | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Definition at line 1015 of file odf2xhtml.py.

Here is the call graph for this function:

## e_style_header()

def odf.odf2xhtml.ODF2XHTML.e_style_header | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Definition at line 1029 of file odf2xhtml.py.

Here is the call graph for this function:

## e_style_page_layout()

def odf.odf2xhtml.ODF2XHTML.e_style_page_layout | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

End this style.

Definition at line 1062 of file odf2xhtml.py.

## e_style_style()

def odf.odf2xhtml.ODF2XHTML.e_style_style | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

End this style.

Definition at line 1129 of file odf2xhtml.py.

## e_table_table()

def odf.odf2xhtml.ODF2XHTML.e_table_table | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

End a table.

Definition at line 1147 of file odf2xhtml.py.

Here is the call graph for this function:

## e_table_table_cell()

def odf.odf2xhtml.ODF2XHTML.e_table_table_cell | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

End a table cell.

Definition at line 1173 of file odf2xhtml.py.

Here is the call graph for this function:

## e_table_table_row()

def odf.odf2xhtml.ODF2XHTML.e_table_table_row | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

End a table row.

Definition at line 1203 of file odf2xhtml.py.

Here is the call graph for this function:

## e_text_a()

def odf.odf2xhtml.ODF2XHTML.e_text_a | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

End an anchor or bookmark reference.

Definition at line 1220 of file odf2xhtml.py.

Here is the call graph for this function:

## e_text_h()

def odf.odf2xhtml.ODF2XHTML.e_text_h | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Headings end Side-effect: If there is no title in the metadata, then it is taken from the first heading of any level.

Definition at line 1266 of file odf2xhtml.py.

Here is the call graph for this function:

## e_text_list()

def odf.odf2xhtml.ODF2XHTML.e_text_list | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

End a list.

Definition at line 1312 of file odf2xhtml.py.

Here is the call graph for this function:

## e_text_list_item()

def odf.odf2xhtml.ODF2XHTML.e_text_list_item | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

End list item.

Definition at line 1335 of file odf2xhtml.py.

Here is the call graph for this function:

## e_text_list_level_style_bullet()

def odf.odf2xhtml.ODF2XHTML.e_text_list_level_style_bullet | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Definition at line 1359 of file odf2xhtml.py.

## e_text_list_level_style_number()

def odf.odf2xhtml.ODF2XHTML.e_text_list_level_style_number | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Definition at line 1381 of file odf2xhtml.py.

## e_text_note()

def odf.odf2xhtml.ODF2XHTML.e_text_note | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Definition at line 1392 of file odf2xhtml.py.

## e_text_note_body()

def odf.odf2xhtml.ODF2XHTML.e_text_note_body | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Definition at line 1403 of file odf2xhtml.py.

## e_text_note_citation()

def odf.odf2xhtml.ODF2XHTML.e_text_note_citation | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Definition at line 1409 of file odf2xhtml.py.

Here is the call graph for this function:

## e_text_p()

def odf.odf2xhtml.ODF2XHTML.e_text_p | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

End Paragraph.

Definition at line 1444 of file odf2xhtml.py.

Here is the call graph for this function:

## e_text_span()

def odf.odf2xhtml.ODF2XHTML.e_text_span | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

End the <text:span>

Definition at line 1483 of file odf2xhtml.py.

Here is the call graph for this function:

## e_text_x_source()

def odf.odf2xhtml.ODF2XHTML.e_text_x_source | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Various indexes and tables of contents.

We ignore those.

Definition at line 1507 of file odf2xhtml.py.

Here is the call graph for this function:

## emptytag()

def odf.odf2xhtml.ODF2XHTML.emptytag | ( |  | self,
|  |  | tag,
|  |  | attrs = `{}`
| ) |  |

Definition at line 560 of file odf2xhtml.py.

Here is the call graph for this function:
Here is the caller graph for this function:

## endElementNS()

def odf.odf2xhtml.ODF2XHTML.endElementNS | ( |  | self,
|  |  | tag,
|  |  | qname
| ) |  |

Definition at line 583 of file odf2xhtml.py.

Here is the call graph for this function:

## generate_footnotes()

def odf.odf2xhtml.ODF2XHTML.generate_footnotes | ( |  | self | ) |

Definition at line 892 of file odf2xhtml.py.

Here is the call graph for this function:
Here is the caller graph for this function:

## generate_stylesheet()

def odf.odf2xhtml.ODF2XHTML.generate_stylesheet | ( |  | self | ) |

Definition at line 864 of file odf2xhtml.py.

Here is the call graph for this function:
Here is the caller graph for this function:

## get_anchor()

def odf.odf2xhtml.ODF2XHTML.get_anchor | ( |  | self,
|  |  | name
| ) |  |

Create a unique anchor id for a href name.

Definition at line 632 of file odf2xhtml.py.

Here is the caller graph for this function:

## handle_endtag()

def odf.odf2xhtml.ODF2XHTML.handle_endtag | ( |  | self,
|  |  | tag,
|  |  | attrs,
|  |  | method
| ) |  |

Definition at line 597 of file odf2xhtml.py.

Here is the caller graph for this function:

## handle_starttag()

def odf.odf2xhtml.ODF2XHTML.handle_starttag | ( |  | self,
|  |  | tag,
|  |  | method,
|  |  | attrs
| ) |  |

Definition at line 594 of file odf2xhtml.py.

Here is the caller graph for this function:

## html_body()

def odf.odf2xhtml.ODF2XHTML.html_body | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Definition at line 845 of file odf2xhtml.py.

Here is the call graph for this function:
Here is the caller graph for this function:

## load()

def odf.odf2xhtml.ODF2XHTML.load | ( |  | self,
|  |  | odffile
| ) |  |

Loads a document into the parser and parses it.

The argument can either be a filename or a document in memory.

Parameters

  odffile | if the type is unicode string: name of a file; else it must be an open file type

Definition at line 1525 of file odf2xhtml.py.

Here is the call graph for this function:
Here is the caller graph for this function:

## odf2xhtml()

def odf.odf2xhtml.ODF2XHTML.odf2xhtml | ( |  | self,
|  |  | odffile
| ) |  |

Load a file and return the XHTML.

Parameters

  odffile | if the type is unicode string: name of a file; else it must be an open file type

Returns
  XHTML code as a a unicode string

Definition at line 1556 of file odf2xhtml.py.

Here is the call graph for this function:

## opentag()

def odf.odf2xhtml.ODF2XHTML.opentag | ( |  | self,
|  |  | tag,
|  |  | attrs = `{}`,
|  |  | block = `False`
| ) |  |

Create an open HTML tag.

Definition at line 540 of file odf2xhtml.py.

Here is the call graph for this function:
Here is the caller graph for this function:

## purgedata()

def odf.odf2xhtml.ODF2XHTML.purgedata | ( |  | self | ) |

Definition at line 640 of file odf2xhtml.py.

Here is the caller graph for this function:

## rewritelink()

def odf.odf2xhtml.ODF2XHTML.rewritelink | ( |  | self,
|  |  | imghref
| ) |  |

Intended to be overloaded if you don't store your pictures in a Pictures subfolder.

Definition at line 765 of file odf2xhtml.py.

Here is the caller graph for this function:

## s_custom_shape()

def odf.odf2xhtml.ODF2XHTML.s_custom_shape | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

A <draw:custom-shape> is made into a

in HTML which is then styled.

Definition at line 682 of file odf2xhtml.py.

Here is the call graph for this function:

## s_draw_fill_image()

def odf.odf2xhtml.ODF2XHTML.s_draw_fill_image | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Definition at line 755 of file odf2xhtml.py.

Here is the call graph for this function:

## s_draw_frame()

def odf.odf2xhtml.ODF2XHTML.s_draw_frame | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

A <draw:frame> is made into a

in HTML which is then styled.

Definition at line 720 of file odf2xhtml.py.

Here is the call graph for this function:

## s_draw_image()

def odf.odf2xhtml.ODF2XHTML.s_draw_image | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

A <draw:image> becomes an element.

Definition at line 771 of file odf2xhtml.py.

Here is the call graph for this function:

## s_draw_object()

def odf.odf2xhtml.ODF2XHTML.s_draw_object | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

A <draw:object> is embedded object in the document (e.g.

spreadsheet in presentation).

Definition at line 785 of file odf2xhtml.py.

Here is the call graph for this function:

## s_draw_object_ole()

def odf.odf2xhtml.ODF2XHTML.s_draw_object_ole | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

A <draw:object-ole> is embedded OLE object in the document (e.g.

MS Graph).

Definition at line 803 of file odf2xhtml.py.

Here is the call graph for this function:

## s_draw_page()

def odf.odf2xhtml.ODF2XHTML.s_draw_page | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

A <draw:page> is a slide in a presentation.

We use a <fieldset> element in HTML. Therefore if you convert a ODP file, you get a series of <fieldset>s. Override this for your own purpose.

Definition at line 815 of file odf2xhtml.py.

Here is the call graph for this function:

## s_draw_textbox()

def odf.odf2xhtml.ODF2XHTML.s_draw_textbox | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Definition at line 832 of file odf2xhtml.py.

Here is the call graph for this function:

## s_ignorecont()

def odf.odf2xhtml.ODF2XHTML.s_ignorecont | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Stop processing the text nodes.

Definition at line 615 of file odf2xhtml.py.

## s_ignorexml()

def odf.odf2xhtml.ODF2XHTML.s_ignorexml | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Ignore this xml element and all children of it It will automatically stop ignoring.

Definition at line 610 of file odf2xhtml.py.

Here is the caller graph for this function:

## s_office_automatic_styles()

def odf.odf2xhtml.ODF2XHTML.s_office_automatic_styles | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Definition at line 910 of file odf2xhtml.py.

## s_office_document_content()

def odf.odf2xhtml.ODF2XHTML.s_office_document_content | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

First tag in the content.xml file.

Definition at line 918 of file odf2xhtml.py.

Here is the call graph for this function:

## s_office_master_styles()

def odf.odf2xhtml.ODF2XHTML.s_office_master_styles | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Definition at line 935 of file odf2xhtml.py.

## s_office_presentation()

def odf.odf2xhtml.ODF2XHTML.s_office_presentation | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

For some odd reason, OpenOffice Impress doesn't define a default-style for the 'paragraph'.

We therefore force a standard when we see it is a presentation

Definition at line 942 of file odf2xhtml.py.

Here is the call graph for this function:

## s_office_spreadsheet()

def odf.odf2xhtml.ODF2XHTML.s_office_spreadsheet | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Definition at line 951 of file odf2xhtml.py.

Here is the call graph for this function:

## s_office_styles()

def odf.odf2xhtml.ODF2XHTML.s_office_styles | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Definition at line 958 of file odf2xhtml.py.

## s_office_text()

def odf.odf2xhtml.ODF2XHTML.s_office_text | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

OpenDocument text.

Definition at line 963 of file odf2xhtml.py.

Here is the call graph for this function:

## s_processcont()

def odf.odf2xhtml.ODF2XHTML.s_processcont | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Start processing the text nodes.

Definition at line 620 of file odf2xhtml.py.

## s_style_default_page_layout()

def odf.odf2xhtml.ODF2XHTML.s_style_default_page_layout | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Collect the formatting for the default page layout style.

Definition at line 1042 of file odf2xhtml.py.

## s_style_default_style()

def odf.odf2xhtml.ODF2XHTML.s_style_default_style | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

A default style is like a style on an HTML tag.

Definition at line 988 of file odf2xhtml.py.

## s_style_font_face()

def odf.odf2xhtml.ODF2XHTML.s_style_font_face | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

It is possible that the HTML browser doesn't know how to show a particular font.

Luckily ODF provides generic fallbacks Unfortunately they are not the same as CSS2. CSS2: serif, sans-serif, cursive, fantasy, monospace ODF: roman, swiss, modern, decorative, script, system

Definition at line 1005 of file odf2xhtml.py.

## s_style_footer()

def odf.odf2xhtml.ODF2XHTML.s_style_footer | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Definition at line 1011 of file odf2xhtml.py.

Here is the call graph for this function:

## s_style_footer_style()

def odf.odf2xhtml.ODF2XHTML.s_style_footer_style | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Definition at line 1020 of file odf2xhtml.py.

## s_style_handle_properties()

def odf.odf2xhtml.ODF2XHTML.s_style_handle_properties | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Copy all attributes to a struct.

We will later convert them to CSS2

Definition at line 975 of file odf2xhtml.py.

## s_style_header()

def odf.odf2xhtml.ODF2XHTML.s_style_header | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Definition at line 1025 of file odf2xhtml.py.

Here is the call graph for this function:

## s_style_header_style()

def odf.odf2xhtml.ODF2XHTML.s_style_header_style | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Definition at line 1034 of file odf2xhtml.py.

## s_style_master_page()

def odf.odf2xhtml.ODF2XHTML.s_style_master_page | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Collect the formatting for the page layout style.

Definition at line 1068 of file odf2xhtml.py.

Here is the call graph for this function:

## s_style_page_layout()

def odf.odf2xhtml.ODF2XHTML.s_style_page_layout | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Collect the formatting for the page layout style.

This won't work in CSS 2.1, as page identifiers are not allowed. It is legal in CSS3, but the rest of the application doesn't specify when to use what page layout

Definition at line 1052 of file odf2xhtml.py.

## s_style_style()

def odf.odf2xhtml.ODF2XHTML.s_style_style | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Collect the formatting for the style.

Styles have scope. The same name can be used for both paragraph and character styles Since CSS has no scope we use a prefix. (Not elegant) In ODF a style can have a parent, these parents can be chained. We may not have encountered the parent yet, but if we have, we resolve it.

Definition at line 1100 of file odf2xhtml.py.

## s_table_table()

def odf.odf2xhtml.ODF2XHTML.s_table_table | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Start a table.

Definition at line 1135 of file odf2xhtml.py.

Here is the call graph for this function:

## s_table_table_cell()

def odf.odf2xhtml.ODF2XHTML.s_table_table_cell | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Start a table cell.

Definition at line 1154 of file odf2xhtml.py.

Here is the call graph for this function:

## s_table_table_column()

def odf.odf2xhtml.ODF2XHTML.s_table_table_column | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Start a table column.

Definition at line 1180 of file odf2xhtml.py.

Here is the call graph for this function:

## s_table_table_row()

def odf.odf2xhtml.ODF2XHTML.s_table_table_row | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Start a table row.

Definition at line 1192 of file odf2xhtml.py.

Here is the call graph for this function:

## s_text_a()

def odf.odf2xhtml.ODF2XHTML.s_text_a | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Anchors start.

Definition at line 1210 of file odf2xhtml.py.

Here is the call graph for this function:

## s_text_bookmark()

def odf.odf2xhtml.ODF2XHTML.s_text_bookmark | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Bookmark definition.

Definition at line 1227 of file odf2xhtml.py.

Here is the call graph for this function:

## s_text_bookmark_ref()

def odf.odf2xhtml.ODF2XHTML.s_text_bookmark_ref | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Bookmark reference.

Definition at line 1237 of file odf2xhtml.py.

Here is the call graph for this function:

## s_text_h()

def odf.odf2xhtml.ODF2XHTML.s_text_h | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Headings start.

Definition at line 1246 of file odf2xhtml.py.

Here is the call graph for this function:

## s_text_line_break()

def odf.odf2xhtml.ODF2XHTML.s_text_line_break | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Force a line break (
)

Definition at line 1283 of file odf2xhtml.py.

Here is the call graph for this function:

## s_text_list()

def odf.odf2xhtml.ODF2XHTML.s_text_list | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Start a list (.

To know which level we're at, we have to count the number of <text:list> elements on the tagstack.

Definition at line 1293 of file odf2xhtml.py.

Here is the call graph for this function:

## s_text_list_item()

def odf.odf2xhtml.ODF2XHTML.s_text_list_item | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Start list item.

Definition at line 1329 of file odf2xhtml.py.

Here is the call graph for this function:

## s_text_list_level_style_bullet()

def odf.odf2xhtml.ODF2XHTML.s_text_list_level_style_bullet | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

CSS doesn't have the ability to set the glyph to a particular character, so we just go through the available glyphs.

Definition at line 1345 of file odf2xhtml.py.

## s_text_list_level_style_number()

def odf.odf2xhtml.ODF2XHTML.s_text_list_level_style_number | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Definition at line 1363 of file odf2xhtml.py.

## s_text_note()

def odf.odf2xhtml.ODF2XHTML.s_text_note | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Definition at line 1385 of file odf2xhtml.py.

Here is the call graph for this function:

## s_text_note_body()

def odf.odf2xhtml.ODF2XHTML.s_text_note_body | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Definition at line 1399 of file odf2xhtml.py.

Here is the call graph for this function:

## s_text_p()

def odf.odf2xhtml.ODF2XHTML.s_text_p | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Paragraph.

Definition at line 1427 of file odf2xhtml.py.

Here is the call graph for this function:

## s_text_s()

def odf.odf2xhtml.ODF2XHTML.s_text_s | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Generate a number of spaces.

ODF has an element; HTML uses We use &#160; so we can send the output through an XML parser if we desire to

Definition at line 1460 of file odf2xhtml.py.

Here is the call graph for this function:

## s_text_span()

def odf.odf2xhtml.ODF2XHTML.s_text_span | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

The <text:span> element matches the element in HTML.

It is typically used to properties of the text.

Definition at line 1469 of file odf2xhtml.py.

Here is the call graph for this function:

## s_text_tab()

def odf.odf2xhtml.ODF2XHTML.s_text_tab | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Move to the next tabstop.

We ignore this in HTML

Definition at line 1491 of file odf2xhtml.py.

Here is the call graph for this function:

## s_text_x_source()

def odf.odf2xhtml.ODF2XHTML.s_text_x_source | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Various indexes and tables of contents.

We ignore those.

Definition at line 1499 of file odf2xhtml.py.

Here is the call graph for this function:

## save()

def odf.odf2xhtml.ODF2XHTML.save | ( |  | self,
|  |  | outputfile,
|  |  | addsuffix = `False`
| ) |  |

Save the HTML under the filename.

If the filename is '-' then save to stdout We have the last style filename in self.stylefilename

Definition at line 1597 of file odf2xhtml.py.

Here is the call graph for this function:

## set_embedable()

def odf.odf2xhtml.ODF2XHTML.set_embedable | ( |  | self | ) |

Tells the converter to only output the parts inside the <body>

Definition at line 474 of file odf2xhtml.py.

## set_plain()

def odf.odf2xhtml.ODF2XHTML.set_plain | ( |  | self | ) |

Tell the parser to not generate CSS.

Definition at line 469 of file odf2xhtml.py.

## startElementNS()

def odf.odf2xhtml.ODF2XHTML.startElementNS | ( |  | self,
|  |  | tag,
|  |  | qname,
|  |  | attrs
| ) |  |

Definition at line 573 of file odf2xhtml.py.

Here is the call graph for this function:

## unknown_endtag()

def odf.odf2xhtml.ODF2XHTML.unknown_endtag | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Definition at line 603 of file odf2xhtml.py.

Here is the caller graph for this function:

## unknown_starttag()

def odf.odf2xhtml.ODF2XHTML.unknown_starttag | ( |  | self,
|  |  | tag,
|  |  | attrs
| ) |  |

Definition at line 600 of file odf2xhtml.py.

Here is the caller graph for this function:

## writedata()

def odf.odf2xhtml.ODF2XHTML.writedata | ( |  | self | ) |

Definition at line 533 of file odf2xhtml.py.

Here is the call graph for this function:
Here is the caller graph for this function:

## writeout()

def odf.odf2xhtml.ODF2XHTML.writeout | ( |  | self,
|  |  | s
| ) |  |

Definition at line 529 of file odf2xhtml.py.

Here is the caller graph for this function:

## xhtml()

def odf.odf2xhtml.ODF2XHTML.xhtml | ( |  | self | ) |

Returns the xhtml.

Definition at line 1572 of file odf2xhtml.py.

Here is the caller graph for this function:

## Member Data Documentation

## anchors

odf.odf2xhtml.ODF2XHTML.anchors

Definition at line 516 of file odf2xhtml.py.

## autoprefix

odf.odf2xhtml.ODF2XHTML.autoprefix

Definition at line 912 of file odf2xhtml.py.

## creator

odf.odf2xhtml.ODF2XHTML.creator

Definition at line 505 of file odf2xhtml.py.

## cs

odf.odf2xhtml.ODF2XHTML.cs

Definition at line 515 of file odf2xhtml.py.

## currentnote

odf.odf2xhtml.ODF2XHTML.currentnote

Definition at line 496 of file odf2xhtml.py.

## currentstyle

odf.odf2xhtml.ODF2XHTML.currentstyle

Definition at line 521 of file odf2xhtml.py.

## data

odf.odf2xhtml.ODF2XHTML.data

Definition at line 506 of file odf2xhtml.py.

## default_styles

string odf.odf2xhtml.ODF2XHTML.default_styles

static

Initial value:
= """
img { width: 100%; height: 100%; }
* { padding: 0; margin: 0; background-color:white; }
body { margin: 0 1em; }
ol, ul { padding-left: 2em; }
"""

Definition at line 857 of file odf2xhtml.py.

## document

odf.odf2xhtml.ODF2XHTML.document

Definition at line 1531 of file odf2xhtml.py.

## elements

odf.odf2xhtml.ODF2XHTML.elements

Definition at line 367 of file odf2xhtml.py.

## familymap

dictionary odf.odf2xhtml.ODF2XHTML.familymap

static

Initial value:
= {'frame':'frame', 'paragraph':'p', 'presentation':'presentation',
'text':'span','section':'div',
'table':'table','table-cell':'td','table-column':'col',
'table-row':'tr','graphic':'graphic' }

Definition at line 980 of file odf2xhtml.py.

## generate_css

odf.odf2xhtml.ODF2XHTML.generate_css

Definition at line 366 of file odf2xhtml.py.

## headinglevels

odf.odf2xhtml.ODF2XHTML.headinglevels

Definition at line 513 of file odf2xhtml.py.

## htmlstack

odf.odf2xhtml.ODF2XHTML.htmlstack

Definition at line 508 of file odf2xhtml.py.

## language

odf.odf2xhtml.ODF2XHTML.language

Definition at line 504 of file odf2xhtml.py.

## lines

odf.odf2xhtml.ODF2XHTML.lines

Definition at line 500 of file odf2xhtml.py.

## listtypes

odf.odf2xhtml.ODF2XHTML.listtypes

Definition at line 512 of file odf2xhtml.py.

## metatags

odf.odf2xhtml.ODF2XHTML.metatags

Definition at line 526 of file odf2xhtml.py.

## notebody

odf.odf2xhtml.ODF2XHTML.notebody

Definition at line 497 of file odf2xhtml.py.

## notedict

odf.odf2xhtml.ODF2XHTML.notedict

Definition at line 495 of file odf2xhtml.py.

## prevstyle

odf.odf2xhtml.ODF2XHTML.prevstyle

Definition at line 1348 of file odf2xhtml.py.

## processcont

odf.odf2xhtml.ODF2XHTML.processcont

Definition at line 511 of file odf2xhtml.py.

## processelem

odf.odf2xhtml.ODF2XHTML.processelem

Definition at line 510 of file odf2xhtml.py.

## pstack

odf.odf2xhtml.ODF2XHTML.pstack

Definition at line 509 of file odf2xhtml.py.

## styledict

odf.odf2xhtml.ODF2XHTML.styledict

Definition at line 520 of file odf2xhtml.py.

## stylefilename

odf.odf2xhtml.ODF2XHTML.stylefilename

Definition at line 487 of file odf2xhtml.py.

## stylestack

odf.odf2xhtml.ODF2XHTML.stylestack

Definition at line 519 of file odf2xhtml.py.

## tagstack

odf.odf2xhtml.ODF2XHTML.tagstack

Definition at line 507 of file odf2xhtml.py.

## title

odf.odf2xhtml.ODF2XHTML.title

Definition at line 503 of file odf2xhtml.py.

## use_internal_css

odf.odf2xhtml.ODF2XHTML.use_internal_css

Definition at line 486 of file odf2xhtml.py.

## xmlfile

odf.odf2xhtml.ODF2XHTML.xmlfile

Definition at line 502 of file odf2xhtml.py.

The documentation for this class was generated from the following file:

- odf/odf2xhtml.py