Annotations

From W3C XForms Group Wiki (Public)
Revision as of 15:58, 27 July 2011 by Dmccrear (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

What Are XForms Annotations?

Within XForms applications there is frequently a need to edit complex content within an XForms textarea element. In a simple use case, this can be simply adding simple formatting markup elements such as bold or italics to the text content of an element. A more complex use case might consist of adding TEI annotations that link person names, dates or geo-locations to controlled vocabularies.

Our hope is that by adding a small number of "Annotation configuration elements" within the textarea element that XForms editors would permit the editing of complex content within a textarea.

This document is a very preliminary discussion about how XForms could be extended to include these annotation functions.

The following are some primary Use Cases that we will discuss. Note that these use cases focus on What will occur but do not discuss how the standard should be implemented.

There seems to be a general consensus among many XForms implementations to use the existing mediatype attribute of the XForms textarea element to specify the type of annotation that will be used. This analysis looks at this proposed recommendation and looks at other possible attributes.

Summary of Proposed XForms Addition

By adding two additional attributes to the XForms textarea element we can permit a higher level of interoperability between XForms applications. In summary we recommend that two additional attributes to the textarea element are:

  mediatype - the mime type of the text element

For example if the textarea has HTML content the textarea element may be:

  <xf:textarea mediatype="text/html">
  </xf:textarea>

If the user is annotating TEI text the mime type would be:

  <xf:textarea mediatype="application/tei+xml">
  </xf:textarea>
  schema - a schema URI associated with with the elements within this text area

Relationship to other W3C Standards

The focus of this XForms extension module is to standardize the way that annotation editors are configured. This is also related to other systems that may want to add annotations such as RDFa annotations. Because our focus is the editing process and the configuration of the editing system we will not be concerned about the standardization of the tags within a xf:textarea, only the process of configuring tools to edit these annotations.

Definitions

We will use the following definitions in our further analysis:

An Annotation Context or context is the containing element that the annotation applies. For example a simple XForms xf:textarea might be a rich-text-editor within a form.

An Annotator Object or annotator is the specific set of information used to annotate at an insertion point or over the selected text.

An Annotator Configuration or configuration is a list of annotators that can be used within a given context such as a textarea element. In general a configuration is a list of the named annotators that can be used within a context.

An Annotation Profile or profile is a named grouping of elements that are traditionally used to annotate text. For example the html-tiny might be a profile of a tiny subset of HTML elements.

A Toolbar will be a list of usually small icons that is frequently displayed above a context such as a textarea.

Use Cases

In addition to these, there are also the Insert which will insert XML at the insertion point, deletes which will remove a selected annotation and edit that will edit the selected annotation. This behavior is assumed and may not impact the way that the annotations are configured.

Examples of Annotation Editors in the Wild

There are many organizations that have already extended both XForms and HTML editors to include the ability to add annotations.

Orbeon Forms

The Orbeon Forms enables HTML rich-text content by allowing the XForms author to add the mediatype attribute to a textarea control. If this is added, the Orbeon forms system automatically makes the textarea a rich-text editing component.

  <xf:textarea mediatype="text/html">

eXSLTForms

The eXSLTForms, Kubera uses the @appearance attribute to change the functioning of the xf:textarea.

Note that Kubera forms allows you to "plugin" other JavaScript based Rich Text Editors Including:

Note that eXSLTForms is designed to work with may different rich-text editors such as CKEdit.

Kubera forms has also been extended to include TEI editing.

BetterForm

  • BetterForm also has support for rich text editors. Like Orbeon, they use the "mediatype" attribute to indicate to the form that a rich-text editor is to be bound to the xf:textarea control.

For example to enable HTML content within a textarea you use the following"

  <xf:textarea mediatype="text/html">

XSmiles

The XSmiles XForms editor also supports XHTML editing.

http://www.x-smiles.org/demo/xforms/folders/xhtmleditor.xhtml

Other Implementations

I also discussed the options with another developer of a commercial XForms product that wanted to remain anonomyus. They indicated that they intended to support the media-type attribute.


The TEIAnn system includes an initial XML file for configuring each textarea. Unfortunately because these systems are based on JavaScript libraries, the configuration is frequently a mix of XML and JSON configuration.

  • Wolfgang Meier has been working on extending the WYMeditor. WYMEditor is a JQuery Rich text editor to also edit TEI documents. Need link... ?

Media Types

For TEI the type is:

 mediatype="application/tei+xml"

References

Key Issues