Arbortext Command Language > Using the Arbortext Command Language > Object Identifier (OID) Functions
  
Object Identifier (OID) Functions
In addition to strings and integers, there is another data type in ACL called an object identifier (OID).
An OID is a unique identifier that locates an element within the structure of a parsed document instance. The OID also records to which document instance the element belongs. This means you can save an OID in a variable, and then later refer to it in OID functions. It makes no difference what the current document is.
An OID is assigned to each start tag when it is parsed or inserted into the document instance. An OID is valid for the duration of an editing session or until the associated object is deleted, for example, by a cut operation.
Not all SGML markup within Arbortext Editor are given OIDs. In particular, character entity references represented by internal tag names starting with &, and the _include and exclude internal tags used to represent included marked sections, are not assigned OIDs because they are not part of the element structure. End tags are not assigned OIDs because the OID for the start tag is sufficient to locate the end of the structure.
File and text entity tags do have object identifiers. That is, OID functions such as oid_next and oid_child return OIDs for file and text entity tags. These entity objects appear as elements with no content, and oid_empty always returns the value of 1.
To descend into an entity, the oid_entity_first function may be used to return the top-level element contained within the entity. For external file entities, the OID returned will be in a different document tree. If oid is the OID of a file entity, oid_doc(oid) != oid_doc(oid_entity_first( oid)) For text entities, the OID returned is in the same tree. Related functions are entity_first, entity_doc, and entity_name.
When the viewchangetracking option is set to all the oid-walking functions will “see” and be able to return change tracking markup. Under any other circumstances they will not. It is acceptable to pass a change tracking markup oid to an oid function no matter what the view setting.
There are several functions that operate on OIDs to permit efficient navigation and interrogation of the document structure. In addition, the logical operators == and != may be used to compare two OIDs for equality. The logical operators <, <=, >, and >= test the ordering of two OIDs. For example, oid1 < oid2 is true if oid1 occurs before oid2 in the document instance. The relational operators do not test structural relationships; the oid_level function can be used for testing if one OID contains another.
The only other operator that permits OIDs as operands is the assignment operator. It is incorrect to use an OID with any other operator (for example, +) or to compare an OID with a number or string.