Arbortext Command Language > Repository API > oid_encl_dobj
  
oid_encl_dobj
oid_encl_dobj (oid[, obj[, pos]])
Returns the document object handle that encloses the element specified by oid and pos (if any). If oid is invalid, or the specified oid is not within a document object, the function returns a zero (0). If the operation is successful, the function returns the document object handle enclosing the specified oid. The dobj_close function must be called to close the document object after it has been processed.
A document can have two types of objects: file entity references and other objects. An oid representing a file entity references may have 2 objects associated with it: one object and one file entity reference object.
If obj is 1, then file entity objects will not be returned. If it is omitted or 0, then a file entity object will be returned if there is one on the parent object oid. This means that if the parent oid has both types of object attached, then the file entity object is returned if obj is omitted or 0.
An XInclude oid can also have multiple objects attached. This method returns the innermost object on the parent object oid if it is an XML inclusion. If you do not want the innermost object, use the dobj_encl_dobj function.
If the parent object oid is not a file entity reference, obj is ignored.
pos can be any of the following values:
0 — (The default.) pos is immediately after the start tag identified by oid.
-1pos is immediately before the end tag of the element identified by oid.
-2pos is immediately before the start tag.
-3 — If oid is a start tag, pos is immediately after the end tag. Otherwise, pos is at the end of the object.