ODFPY: odf.odf2xhtml.ODF2XHTML Class Reference

ODFPY 1.2.0 |

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

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

Definition at line 364 of file odf2xhtml.py.

## Member Function Documentation

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.

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

Definition at line 569 of file odf2xhtml.py.

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:

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:

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

Definition at line 1392 of file odf2xhtml.py.

Here is the caller graph for this function:

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

Returns the CSS content.

Definition at line 1580 of file odf2xhtml.py.

Here is the call graph for this function:

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:

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.

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.

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.

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.

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:

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

Definition at line 826 of file odf2xhtml.py.

Here is the call graph for this function:

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

End the <draw:text-box>

Definition at line 839 of file odf2xhtml.py.

Here is the call graph for this function:

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

Last tag.

Definition at line 927 of file odf2xhtml.py.

Here is the call graph for this function:

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

Definition at line 944 of file odf2xhtml.py.

Here is the call graph for this function:

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

Definition at line 951 of file odf2xhtml.py.

Here is the call graph for this function:

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

Definition at line 964 of file odf2xhtml.py.

Here is the call graph for this function:

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

Definition at line 992 of file odf2xhtml.py.

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

Definition at line 1012 of file odf2xhtml.py.

Here is the call graph for this function:

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

Definition at line 1026 of file odf2xhtml.py.

Here is the call graph for this function:

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

End this style.

Definition at line 1059 of file odf2xhtml.py.

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

End this style.

Definition at line 1126 of file odf2xhtml.py.

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

End a table.

Definition at line 1144 of file odf2xhtml.py.

Here is the call graph for this function:

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

End a table cell.

Definition at line 1170 of file odf2xhtml.py.

Here is the call graph for this function:

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

End a table row.

Definition at line 1200 of file odf2xhtml.py.

Here is the call graph for this function:

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

End an anchor or bookmark reference.

Definition at line 1217 of file odf2xhtml.py.

Here is the call graph for this function:

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 1263 of file odf2xhtml.py.

Here is the call graph for this function:

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

End a list.

Definition at line 1309 of file odf2xhtml.py.

Here is the call graph for this function:

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

End list item.

Definition at line 1332 of file odf2xhtml.py.

Here is the call graph for this function:

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

Definition at line 1356 of file odf2xhtml.py.

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

Definition at line 1378 of file odf2xhtml.py.

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

Definition at line 1389 of file odf2xhtml.py.

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

Definition at line 1400 of file odf2xhtml.py.

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

Definition at line 1406 of file odf2xhtml.py.

Here is the call graph for this function:

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

End Paragraph.

Definition at line 1441 of file odf2xhtml.py.

Here is the call graph for this function:

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

End the <text:span>

Definition at line 1480 of file odf2xhtml.py.

Here is the call graph for this function:

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

Various indexes and tables of contents.

We ignore those.

Definition at line 1504 of file odf2xhtml.py.

Here is the call graph for this function:

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:

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

Definition at line 583 of file odf2xhtml.py.

Here is the call graph for this function:

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

Definition at line 889 of file odf2xhtml.py.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 861 of file odf2xhtml.py.

Here is the call graph for this function:

Here is the caller graph for this function:

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:

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:

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:

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

Definition at line 842 of file odf2xhtml.py.

Here is the call graph for this function:

Here is the caller graph for this function:

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 1522 of file odf2xhtml.py.

Here is the call graph for this function:

Here is the caller graph for this function:

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 1553 of file odf2xhtml.py.

Here is the call graph for this function:

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:

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

Definition at line 640 of file odf2xhtml.py.

Here is the caller graph for this function:

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:

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:

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:

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:

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:

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:

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 800 of file odf2xhtml.py.

Here is the call graph for this function:

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 812 of file odf2xhtml.py.

Here is the call graph for this function:

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

Definition at line 829 of file odf2xhtml.py.

Here is the call graph for this function:

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

Stop processing the text nodes.

Definition at line 615 of file odf2xhtml.py.

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:

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

Definition at line 907 of file odf2xhtml.py.

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

First tag in the content.xml file.

Definition at line 915 of file odf2xhtml.py.

Here is the call graph for this function:

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

Definition at line 932 of file odf2xhtml.py.

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 939 of file odf2xhtml.py.

Here is the call graph for this function:

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

Definition at line 948 of file odf2xhtml.py.

Here is the call graph for this function:

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

Definition at line 955 of file odf2xhtml.py.

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

OpenDocument text.

Definition at line 960 of file odf2xhtml.py.

Here is the call graph for this function:

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

Start processing the text nodes.

Definition at line 620 of file odf2xhtml.py.

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

Collect the formatting for the default page layout style.

Definition at line 1039 of file odf2xhtml.py.

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 985 of file odf2xhtml.py.

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 1002 of file odf2xhtml.py.

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

Definition at line 1008 of file odf2xhtml.py.

Here is the call graph for this function:

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

Definition at line 1017 of file odf2xhtml.py.

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 972 of file odf2xhtml.py.

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

Definition at line 1022 of file odf2xhtml.py.

Here is the call graph for this function:

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

Definition at line 1031 of file odf2xhtml.py.

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

Collect the formatting for the page layout style.

Definition at line 1065 of file odf2xhtml.py.

Here is the call graph for this function:

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 1049 of file odf2xhtml.py.

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 1097 of file odf2xhtml.py.

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

Start a table.

Definition at line 1132 of file odf2xhtml.py.

Here is the call graph for this function:

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

Start a table cell.

Definition at line 1151 of file odf2xhtml.py.

Here is the call graph for this function:

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

Start a table column.

Definition at line 1177 of file odf2xhtml.py.

Here is the call graph for this function:

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

Start a table row.

Definition at line 1189 of file odf2xhtml.py.

Here is the call graph for this function:

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

Anchors start.

Definition at line 1207 of file odf2xhtml.py.

Here is the call graph for this function:

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

Bookmark definition.

Definition at line 1224 of file odf2xhtml.py.

Here is the call graph for this function:

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

Bookmark reference.

Definition at line 1234 of file odf2xhtml.py.

Here is the call graph for this function:

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

Headings start.

Definition at line 1243 of file odf2xhtml.py.

Here is the call graph for this function:

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

Force a line break (
)

Definition at line 1280 of file odf2xhtml.py.

Here is the call graph for this function:

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 1290 of file odf2xhtml.py.

Here is the call graph for this function:

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

Start list item.

Definition at line 1326 of file odf2xhtml.py.

Here is the call graph for this function:

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 1342 of file odf2xhtml.py.

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

Definition at line 1360 of file odf2xhtml.py.

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

Definition at line 1382 of file odf2xhtml.py.

Here is the call graph for this function:

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

Definition at line 1396 of file odf2xhtml.py.

Here is the call graph for this function:

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

Paragraph.

Definition at line 1424 of file odf2xhtml.py.

Here is the call graph for this function:

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 1457 of file odf2xhtml.py.

Here is the call graph for this function:

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 1466 of file odf2xhtml.py.

Here is the call graph for this function:

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

Move to the next tabstop.

We ignore this in HTML

Definition at line 1488 of file odf2xhtml.py.

Here is the call graph for this function:

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

Various indexes and tables of contents.

We ignore those.

Definition at line 1496 of file odf2xhtml.py.

Here is the call graph for this function:

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 1594 of file odf2xhtml.py.

Here is the call graph for this function:

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.

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

Tell the parser to not generate CSS.

Definition at line 469 of file odf2xhtml.py.

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:

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:

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:

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:

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

Definition at line 529 of file odf2xhtml.py.

Here is the caller graph for this function:

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

Returns the xhtml.

Definition at line 1569 of file odf2xhtml.py.

Here is the caller graph for this function:

## Member Data Documentation

odf.odf2xhtml.ODF2XHTML.anchors

Definition at line 516 of file odf2xhtml.py.

odf.odf2xhtml.ODF2XHTML.autoprefix

Definition at line 909 of file odf2xhtml.py.

odf.odf2xhtml.ODF2XHTML.creator

Definition at line 505 of file odf2xhtml.py.

odf.odf2xhtml.ODF2XHTML.cs

Definition at line 515 of file odf2xhtml.py.

odf.odf2xhtml.ODF2XHTML.currentnote

Definition at line 496 of file odf2xhtml.py.

odf.odf2xhtml.ODF2XHTML.currentstyle

Definition at line 521 of file odf2xhtml.py.

odf.odf2xhtml.ODF2XHTML.data

Definition at line 506 of file odf2xhtml.py.

string odf.odf2xhtml.ODF2XHTML.default_styles
| static

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

Definition at line 854 of file odf2xhtml.py.

odf.odf2xhtml.ODF2XHTML.document

Definition at line 1528 of file odf2xhtml.py.

odf.odf2xhtml.ODF2XHTML.elements

Definition at line 367 of file odf2xhtml.py.

dictionary odf.odf2xhtml.ODF2XHTML.familymap
| static

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

Definition at line 977 of file odf2xhtml.py.

odf.odf2xhtml.ODF2XHTML.generate_css

Definition at line 366 of file odf2xhtml.py.

odf.odf2xhtml.ODF2XHTML.headinglevels

Definition at line 513 of file odf2xhtml.py.

odf.odf2xhtml.ODF2XHTML.htmlstack

Definition at line 508 of file odf2xhtml.py.

odf.odf2xhtml.ODF2XHTML.language

Definition at line 504 of file odf2xhtml.py.

odf.odf2xhtml.ODF2XHTML.lines

Definition at line 500 of file odf2xhtml.py.

odf.odf2xhtml.ODF2XHTML.listtypes

Definition at line 512 of file odf2xhtml.py.

odf.odf2xhtml.ODF2XHTML.metatags

Definition at line 526 of file odf2xhtml.py.

odf.odf2xhtml.ODF2XHTML.notebody

Definition at line 497 of file odf2xhtml.py.

odf.odf2xhtml.ODF2XHTML.notedict

Definition at line 495 of file odf2xhtml.py.

odf.odf2xhtml.ODF2XHTML.prevstyle

Definition at line 1345 of file odf2xhtml.py.

odf.odf2xhtml.ODF2XHTML.processcont

Definition at line 511 of file odf2xhtml.py.

odf.odf2xhtml.ODF2XHTML.processelem

Definition at line 510 of file odf2xhtml.py.

odf.odf2xhtml.ODF2XHTML.pstack

Definition at line 509 of file odf2xhtml.py.

odf.odf2xhtml.ODF2XHTML.styledict

Definition at line 520 of file odf2xhtml.py.

odf.odf2xhtml.ODF2XHTML.stylefilename

Definition at line 487 of file odf2xhtml.py.

odf.odf2xhtml.ODF2XHTML.stylestack

Definition at line 519 of file odf2xhtml.py.

odf.odf2xhtml.ODF2XHTML.tagstack

Definition at line 507 of file odf2xhtml.py.

odf.odf2xhtml.ODF2XHTML.title

Definition at line 503 of file odf2xhtml.py.

odf.odf2xhtml.ODF2XHTML.use_internal_css

Definition at line 486 of file odf2xhtml.py.

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