ODF and annotations

From: Ben Martin <monkeyiq_at_users.sourceforge.net>
Date: Mon Oct 24 2011 - 23:49:51 CEST

   Martin Sevior pointed out to me that currently the range of an
annotation is not preserved by abiword when saved & loaded again through
ODF. I started digging into this and the ODF IO paths write
office:annotation elements but do not use office:annotation-end to mark
the end of the range.

   The ODF spec lists annotation-end in 13.2 as being an XML element
which can be optionally used to define the end of a text range for the
annotation. Having experimented in LO (libreoffice-core from
Fedora 15, an ODF file using annotation-end loads OK but doesn't show
the scope. On save the scope is dropped by LO back to a single point
annotation. This leads me to believe that LO is simply ignoring the
annotation-end marker as it uses margin notes to show annotations.

  I propose to add support for writing and reading annotation-end to
abiword ODF code in trunk. I already have some code to read such files.
As the use of annotation-end still relies on the same annotation XML
element to mark the start of range, ODF files produced this way should
still read in the same way in other applications which do not support
annotation ranges (such as LO).

  For demonstration purposes, if one has an abw chunk like the below,
sans my newlines and whitespace for readability:

<p style="Normal" xid="2">
  This is the
    <ann annotation="x" xid="3">
      <annotate annotation-id="0"
   props="annotation-author:was me; annotation-date:10-20-2011">
        <p style="Normal" xid="4"> base text xxx</p>
base text of
the document</p>

Then the equivalent ODT might be something like the below. If an
application ignores annotation-end then they get an annotation
associated with a single point in the document instead of a range.

<text:p text:style-name="Normal" >
  This is the
  <office:annotation office:name="foo">
    <dc:creator>was me</dc:creator>
  <text:p text:style-name="Normal" >base text <text:s/>xxx
base text of
  <office:annotation-end office:name="foo"/>
the document</text:p>

Received on Mon Oct 24 23:50:11 2011

This archive was generated by hypermail 2.1.8 : Mon Oct 24 2011 - 23:50:11 CEST