This document describes the core of the LMNL object model or LOM. This API is designed to enable you to access information from a LMNL data model and to provide the core functionality on which other LOM modules can be based.
Last modified 8 Oct 2002 by Jeni Tennison.
As in the DOM, a LOMString is used to ensure
interoperability between implementations by specifying the encoding used to
represent sequences of characters. LOMString uses UTF-16 encoding;
in addition the contents of a LOMString must be Unicode normalized
according to
Unicode
Normalization Form NFC.
An ExpandedName represents a
expanded name.
| interface ExpandedName { | ||||
| readonly | attribute | LOMString | namespaceName; | |
| readonly | attribute | LOMString | localPart; | |
|
|
equals(in ExpandedName name); | |||
| } | ||||
| Attribute | Notes |
|---|---|
namespaceName |
The namespace name of the expanded name. If the expanded name “has no namespace” then this returns an empty string. |
localPart |
The local part of the expanded name. |
| Method | Notes |
|---|---|
equals(ExpandedName name) |
Returns |
The LOMImplementation provides features for setting
properties that are not related to a particular Document.
| interface LOMImplementation { | ||||
|
|
hasFeature(in LOMString feature); | |||
| } | ||||
| Method | Notes |
|---|---|
hasFeature(LOMString feature) |
Returns |
Item is to LOM what Node is to DOM. It's the
basic interface for all objects in the model.
| interface Item { | ||||
| const | attribute |
|
RANGE; | |
| const | attribute |
|
ANNOTATION; | |
| const | attribute |
|
LAYER; | |
| const | attribute |
|
DOCUMENT; | |
| readonly | attribute |
|
itemType; | |
| readonly | attribute | Document | document; | |
| readonly | attribute | ExpandedName | name; | |
| readonly | attribute | Sequence | annotations; | |
| readonly | attribute | LOMString | value; | |
| } | ||||
| Constant | Notes |
|---|---|
RANGE |
The |
ANNOTATION |
The |
LAYER |
The |
DOCUMENT |
The |
| Attribute | Notes |
|---|---|
itemType |
The type of the |
document |
The Document to which the item belongs. |
name |
The ExpandedName representing the
name of the
range or
name of the
annotation represented by this
|
annotations |
A Sequence of Annotations representing the
annotations of the
range or
annotations of the
annotation represented by this
|
value |
A LOMString giving the value of the |
A Sequence holds a sequence of Items.
Sequences are live; they will update if the
document changes.
| interface Sequence { | ||||
| readonly | attribute |
|
itemType; | |
| readonly | attribute |
|
length; | |
|
|
item(in
|
|||
|
|
getItemsNamed(in LOMString namespaceName, in LOMString localPart); | |||
|
|
getItemsInNamespace(in LOMString namespace); | |||
| } | ||||
| Attribute | Notes |
|---|---|
itemType |
The type of the Items in the |
length |
The number of Items in the |
| Method | Notes |
|---|---|
item(
|
Returns the Item at the index passed as the argument,
or |
getItemsNamed(LOMString namespaceName, LOMString localPart) |
Returns a |
getItemsInNamespace(LOMString namespace) |
Returns a |
A Layer represents a layer in the data model. Its itemType is Item.LAYER and its name and annotations are both
null.
| interface Layer : Item { | ||||
| readonly | attribute | Layer | base; | |
| readonly | attribute | Sequence | content; | |
| readonly | attribute | Sequence | overlays; | |
| } | ||||
| Attribute | Notes |
|---|---|
base |
The base of the
layer. Returns |
content |
The Sequence of Ranges in the content of the
layer. Returns |
overlays |
The Sequence of |
A Document is a kind of Layer that represents
a document. Its itemType is
Item.DOCUMENT; its value is the
content of the document, as a
LOMString; its document, name, annotations, base and content are all
null.
| interface Document : Layer { | ||||
| readonly | attribute | LOMImplementation | implementation; | |
| } | ||||
| Attribute | Notes |
|---|---|
implementation |
The LOMImplementation that handles the
|
A Range is an Item that represents a
range. Its itemType is Item.RANGE.
The start and end of a range are not exposed through this API, but they are used by a LOM implementation to construct the Sequences of Ranges.
| interface Range : Item { | ||||
| readonly | attribute | Layer | ownerLayer; | |
| readonly | attribute | Sequence | valueSequence; | |
| readonly | attribute | Sequence | clones; | |
| readonly | attribute | Sequence | closestEnclosing; | |
| readonly | attribute | Sequence | closestEnclosed; | |
| readonly | attribute | Sequence | lastPreceding; | |
| readonly | attribute | Sequence | firstFollowing; | |
| readonly | attribute | Sequence | startOverlaps; | |
| readonly | attribute | Sequence | endOverlaps; | |
|
|
isClone(in Range range); | |||
|
|
isWithin(in Range range); | |||
|
|
encloses(in Range range); | |||
|
|
follows(in Range range); | |||
|
|
precedes(in Range range); | |||
|
|
overlapsStart(in Range range); | |||
|
|
overlapsEnd(in Range range); | |||
| } | ||||
| Attribute | Notes |
|---|---|
ownerLayer |
The owner-layer of the range as a Layer. |
valueSequence |
The value of the
range as a Sequence of
|
clones |
|
closestEnclosing |
A Sequence of |
closestEnclosed |
A Sequence of |
lastPreceding |
A Sequence of |
firstFollowing |
A Sequence of |
startOverlaps |
A Sequence of |
endOverlaps |
A Sequence of |
| Method | Notes |
|---|---|
isClone(Range range) |
Returns |
isWithin(Range range) |
Returns |
encloses(Range range) |
Returns |
follows(Range range) |
Returns |
precedes(Range range) |
Returns |
overlapsStart(Range range) |
Returns |
overlapsEnd(Range range) |
Returns |
A Annotation is an Item that represents a
annotation. Its itemType is
Item.ANNOTATION.
| Attribute | Notes |
|---|---|
owner |
The Item (a Range or
|
valueLayer |
The Layer (a text layer) that represents the value of the annotation. |
| © 2002 by the authors and LMNL.org All rights reserved |
![]() |