bind


String bind (String contextXPointer, String relativeXPointer, String atXPointer)

Bind a new element and return its XPointer.

 contextXPointer The first matching element for contextXPointer will be used as the context. The context is the point from where the relativeXPointer will start.

Note: Use "#/1" for document element.
 relativeXPointer The new elements will have names defined by relativeXPointer.
 atXPointer The new elements will be bound at the locations defined by relativeXPointer.

Note: if name is "*", then element will be added (at the end).

Code snippet

Add a branch at the root level

var docElement = "#/1";
var newElement = "#xpointer(has/b)";
var at = "#xpointer(*/*)";

diputree.bind (docElement, newElement, at);

Example

bind example


diputree documentation © 2000 dipu