Arbortext Command Language > Callbacks > doc_add_callback > insert_include_path Callback Type
  
insert_include_path Callback Type
Function prototype:
function funcname (doc, attrs[])
insert_include_path is called before an XML inclusion reference is inserted by the insert_include command. The callback can optionally modify the path value that will be stored on the href attribute value of the inserted XML inclusion tag.
Arguments:
doc — The document in which the XML inclusion reference is being inserted.
attrs[] — An associative array containing the attributes of the XML inclusion tag. If any values changed by the callback, -1 is returned.
Example
function my_insert_include_path_callback(doc, attrs[])
{
local original_href = attrs['href'];
local new_href = original_href;
# possibly alter new_href here.
if (original_href != new_href)
{
attrs['href'] = new_href;
return -1; # force use of this new href
}
return 0; # continue as normal
}
doc_add_callback(doc, 'insert_include_path', 'my_insert_include_path_callback')