Arbortext Command Language > Callbacks > doc_add_callback > insert_include Callback Type
  
insert_include Callback Type
Function prototype:
function funcname (doc, uri, parse, op)
insert_include is called before an XML inclusion reference is inserted by the insert_include command. If the callback function inserts the reference itself, it should return -1.
Arguments:
doc — The document in which the XML inclusion reference is being inserted.
uri — The resolved path to the resource (file) to be inserted.
parse — The value of the parse attribute of the XML inclusion.
op is the function callback operation. Callbacks are called twice in succession with op specifying the stage of callback operation.
1. op == 1 first call — The returned argument specifies whether the execution should continue or be stopped:
0 — Continue callback processing.
-1 — Stop further callback processing.
2. op == 2 second call — Occurs unless the processing was stopped during the first call. The returned argument allows or prevents basic Arbortext Editor processing after all callbacks have been called:
0 — Basic Arbortext Editor processing allowed.
-1 — Basic Arbortext Editor processing prevented.
Example
function my_insert_include_callback(doc, uri, parse, op)
{
}
doc_add_callback(doc, 'insert_include', 'my_insert_include_callback')
Related Topics
insert_entity callback type