Global

Type Definitions


callback(context, data, next, done)

A callback function can be used to access and modify the context and data object at the current point in the command chain.
This:
Parameters:
Name Type Argument Description
context context The current HTML/XML context
data data The current data object
next next <optional>
Continue a context and data down the chain
done done <optional>
Called when finished calling next
See:
  • Command.then

context

An XML/HTML DOM object represting a Document, Element, Attribute or other Node.
Type:
  • object

data

An object containing values set by `.set`
Type:
  • object
See:
  • Command.set

done()

The done function is used to tell Osmosis that a callback has finished **asynchronous** execution. The done function is required if the callback function calls next asynchronously. The done function MUST be called if it is included as an argument to the callback function. Note: You must not call next after calling done.
See:

middlewareCallback(context, data)

A callback function that returns the desired value.
Parameters:
Name Type Description
context context The current XML/HTML context node.
data data The current data object.

next(context, data)

The next function is used to send a context and a data object to the immediately following Command. The next function must be called if you want to change the context or data object.
Parameters:
Name Type Description
context context The context to send to the following command
data data The data object to send to the following command
See:

Selector

A CSS/XPath selector
Type:
  • string
See: