emacs-devel
[Top][All Lists]
Advanced

[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:body>
      <office:text>
        <office:forms form:automatic-focus="false" 
form:apply-design-mode="false"/>
        <text:sequence-decls>
          <text:sequence-decl text:display-outline-level="0"
                              text:name="Illustration"/>
          <text:sequence-decl text:display-outline-level="0" 
                              text:name="Table"/>
          <text:sequence-decl text:display-outline-level="0" 
                              text:name="Text"/>
          <text:sequence-decl text:display-outline-level="0" 
                              text:name="Drawing"/>
        </text:sequence-decls>
  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 
text:style-name="Standard"/>

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


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
http://www.tapsellferrier.co.uk   




reply via email to

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