lookupAll


String lookupAll (String contextXPointer, String relativeXPointer, String separator)

Returns a string of xpointers of all matching elements separated by the separator or an empty string if no match was found.

 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 All matching elements for relativeXPointer will be returned.
 separator The separator character to separate the xpointers from each other.

Remarks

array String.split (separator)

The JavaScript function split operates on a String value, takes a separator as an argument and returns an Array. This gives you an easy way to convert the result string from lookupAll to an Array.

Code snippet

Look up all second level leafs.

var docElement = "#/1";
var xptr = "#xpointer(has/b/has/l)";

var leafsStr = diputree.lookupAll (docElement, xptr, " ");
var leafs = leafStr.split(" ");

Example

lookupAll example


diputree documentation © 2000 dipu