Arbortext Command Language > Functions by Alphabetical Listing > context_paths
  
context_paths
context_paths (arr, tag[, depth[, oid[, pos]]])
* 
The context_paths function is being deprecated. When writing new applications, use context_full_paths instead.
This function fills the array arr with a list of possible context paths of no more than depth tags to make the target element tag in context at the point in the document given by oid, pos. If oid is omitted, the cursor position in the current document is used. If depth is omitted, a depth of 5 is used.
* 
If you have applied an alias map to the document, tag can be an alias or a real name. However, this function will return an element's real name, not its alias.
context_paths returns the number of paths stored in the array. Each path returned is expressed as a context string as formatted by the context_string function. The array is ordered by path depth, with the shallowest paths first.
For compatibility with previous versions, each path returned starts with the enclosing tag at the cursor position or at the oid pos passed in. For example, if the cursor is just inside a chapter tag, then context_paths(arr,"para") will return an array of paths that start with "chapter(". If that is not the desired result, use the context_full_paths function when writing new applications.
The context_paths function does not add required sibling elements to the paths returned. For example, if the content model for chapter is (title,para*) and the cursor is just inside a chapter tag, then context_paths(arr,"para") will return "chapter(" rather than "chapter(title()". If you want required siblings to be added, use the context_full_paths function.
* 
The context_paths function returns an empty array if the cursor is positioned at the beginning of the document.