ODF visualization using WebKit

2010-06-23

Today is day 1 of of the OdfKit Hack Week. We wrote a list of things we want to achieve this week. In order to avoid embarrassment, we’ll spare you the details and go straight through to an explanation of how you can use WebKit (or any modern browser) to visualize ODF documents. The general idea is to incorporate the ODF XML into a live HTML document.

Step 0: load content and styles into an HTML document

ODF files come in two flavors: single XML files and XML files in ZIP containers. Most people use the ZIP form exclusively. In both cases there are two XML elements of importance: <document-content/> and <document-styles/>. These are comparable to HTML and CSS respectively. We’ll avoid the details of how we load these elements into the DOM tree for now and simply state that we have two javascript variables:

using namespaces in CSS:

our demo page.

Comments

Post a comment