[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Saving markup formats

From: Nic James Ferrier
Subject: Re: Saving markup formats
Date: Wed, 20 Jun 2007 00:40:31 +0100

Richard Stallman <address@hidden> writes:

> To save files as RTF does not require that we use the structured
> nesting features of RTF.  We want to be able to read such RTF files,
> and when doing som we can either flatten the structure or record it by
> means of markup text (effectively, open and close braces in the text
> itself).

That's interesting. You see emacs buffers as a primary contruct in the
implementation of a word processor.

I'd prefer to be talking about something other than RTF, say OpenDoc,
because it is acutally more useful now than RTF.

I'm not an expert, but I've done a little hacking with OpenDoc. It is
an XML format but comes wrapped up in a zip file.

In otherwords if I give you my CV in OpenDoc I'm giving you a zip file
with a number of XML files in it.

There always seems to be one XML file with the content of the document
in it. It consists of a number of logical style definitions followed
by markup describing the content of the document and applying styles.

Here's a little bit of content from the top of an OpenDoc document:

        <office:forms form:automatic-focus="false" 
          <text:sequence-decl text:display-outline-level="0"
          <text:sequence-decl text:display-outline-level="0" 
          <text:sequence-decl text:display-outline-level="0" 
          <text:sequence-decl text:display-outline-level="0" 
  Nic Ferrier
  <text:h text:style-name="Heading_20_1">Nic Ferrier - Curriculum Vitae</text:h>
  <text:p text:style-name="Standard">Nic is a hacker.</text:p><text:p 

It's mostly gobbledegook, as you can see. Checking the schema for
OpenDoc I note that most of the above (the office:forms element and
the text:sequence-decls element) is optional.

Now, an emacs textual representation of a styled document would seem
to be a really useful thing to have. This would be capable of
attaching styles to text via properties. The styles would come from
one of a number of sets of predefined styles; there might be an HTML
set or an OpenDoc set.

The definition of a style would have to be very loose. Probably just a
text string as an identifier and then something attached to the text

Then we could write importers to the styled form and "displayers" of
the styled form, like the current emacs rich text mode. The styles
would be defined by the import/export programs and the "displayer".

It would be a start.

I think such a plan would require nxml-mode, at least James Clark's
xmltok lisp library which comes with nxml-mode.

Nic Ferrier

reply via email to

[Prev in Thread] Current Thread [Next in Thread]