DOMImporter
Class defined in model/DOMImporter.js#25

A generic base implementation for XML/HTML importers.

Converts and shows all children of a given element.

Parameters
elementsDOMElement[]

All elements that should be converted into the container.

containerIdString

The id of the target container node.

Returns
Object

the preliminary container node

Converts a single HTML element and creates a node in the current document.

Parameters
elDOMElement

the HTML element

Returns
object

the created node as JSON

Convert annotated text. You should call this method only for elements containing rich-text.

Parameters
elDOMElement
pathString[]

The target property where the extracted text (plus annotations) should be stored.

optionsObject
options.preserveWhitespaceBoolean

when true will preserve whitespace. Default: false.

Returns
String

The converted text as plain-text

Converts the given element as plain-text.

Parameters
elDOMElement
Returns
String

The plain text

Tells the converter to insert a virutal custom text.

This is useful when during conversion a generated label needs to be inserted instead of real text.

Parameters
String

Generates an id. The generated id is unique with respect to all ids generated so far.

Parameters
aString

prefix

Returns
String

the generated id

Wraps the remaining (inline) elements of a node iterator into a default block node.

Parameters
childIteratorDOMImporter.ChildIterator
Returns
model/DocumentNode

Converts an element into a default block level node.

Parameters
elDOMElement
Returns
model/DocumentNode

Removes any leading and trailing whitespaces from the content within the given element. Attention: this is not yet implemented fully. Atm, trimming is only done on the first and last text node (if they exist).

Parameters
$eljQuery
Returns
util/jQuery

an element with trimmed text