SedInstance

From SynchroEdit

Jump to: navigation, search

Contents

Interface implementation "SedInstance":

Revision 10 (April 22, 2006)

Changelog

Revision    Date            Description
5           Aug 16, 2005    Implemented plusOffset feature in nodeIdentifiers
6           Aug 18, 2005    Clarified specification on body and head tags.
7           Aug 23, 2005    Added ".*" feature for optimizing document-loading.
8           Aug 24, 2005    Replaced ".*" feature with different handler in server.
9           Feb 21, 2006    Corrected example and spec regarding pipeline-referencing.
10          Apr 22, 2006    Renamed specification to "SedInstance" from "DomInstance".

Comment

This specification (and its accompanying implementations) was called Dom* up until April 22, 2006. This was obviously a thoughtless move as it both insinuates that the specification is W3C compliant (which it most assuredly isn't), and that it was written by the W3C team. These specifications (and accompanying implementations) have thus been renamed to Sed* (Synchronously edited document).

Type definitions

  • nodeIdentifier <string>; point-separated list with an anchor-reference, followed by any number of node-tree-index references, optionally followed by a pipeline and an integer value, indicating that the node reference is based off of a sibling.
    • Must be able to process trailing dots.
    • nodeType <int>; one of the values specified in the NT_* definitions.

Specifications

  • All html code must begin with an <html> tag. The <html> tag may be anonymous, but must contain a <head> tag and a <body> tag. The <head> tag must contain a <style> tag. The <body> tag must have the id attribute set to "body". The <head> tag must have the id attribute set to "head". The <style> tag must have the id attribute set to "style".

Functions

Node getNodeIdentifiedAs(nodeIdentifier identity)

Find a node based on a node identifier

nodeIdentifier get!NodeIdentifierFor(Node n, boolean ignoreNodeType)

Produce the node identifier for a particular node.
If ignoreNodeType is set, the first node checked (which is the youngest child) will always produce an index, never an element identifier.

void insertNodeAfter(Node n, nodeIdentifier afterWhat)

Insert n directly beneath afterWhat.

Element spawnElement(String elementTagName)

Create a new element of element!TagName-type.

String next!ElementFor(String elementTagName)

Produce the next element identity for an element of element!TagName-type.

void identifyElement(Element e)

Deanonymize an element using the internal settings.

void renameElement(Element e, String newName)

Rename an element to newName.

void set!NodeText(nodeIdentifier where, String toWhat)

Set the text in a specific node to toWhat.

Node insert!NewNodeAs(nodeIdentifier resultingIdentifier, nodeType ofType, String elementTagName, String elementNewId, String textContent)

Create a new node of type ofType, put it into the DOM tree so that its nodeIdentifier matches resultingIdentifier, and set its text to textContent; if it is an element, additionally set the tag name to elementTagName and the identifier to elementNewId. The new node is returned.

void removeNode(nodeIdentifier which)

Remove the node that corresponds to the which nodeIdentifier.

Document getInstance()

Acquire the document instance.
Personal tools