Arbortext Command Language > Hooks > entitydeclconflicthook
  
entitydeclconflicthook
entitydeclconflicthook
 
Function prototype:
hook (docid, dobj, entityname, entitytype, entitysubtype, pubid, sysid, notn, text)
Synopsis
Use with:
add_hook(hookname, func)
remove_hook(hookname, func)
where hookname is entitydeclconflicthook.
This hook will be called when there is an entity whose declaration in the internal subset and one in the external subset (usually called the DTD).
Arguments
docid is the document identifier of the document in which the declaration was found.
dobj is the document object identifier of the document object in which the declaration was found.
entityname is the entity name with either & or % prefix.
entitytype is the entity type (that is: file, text, graphic, char, filep, msp, accent).
entitysubtype is the entity subtype, that is:
for text — CDATA, PI, MS, MD, or empty string (normal)
for file — SUBDOC, or empty string (normal)
for graphic — for graphic — NDATA, SDATA, CDATA
pubid is the point in processing where the hook is called. It is a literal string value that is passed by the publishing framework to the hook function each time the framework calls it. For each string, there is a corresponding ACL variable that specifies the point of operation.
The complete list of variables and where values is located in compose.acl. Search for HK_.
sysid is the parameter array that holds the parameters and values to be used by the pipeline.
notn is the document identifier of the document being published.
text is the document identifier of the document being published.
* 
The file, filep, and graphic entity types are external. The text, msp, char, and accent entity types are internal.
The hook function should return a string to use as the entity name, either without any prefix at all, or with the same prefix as was passed in (& or %). There are two cases with regards to the string returned:
1. If a blank string is returned, or if the string returned is the name of an already existing entity, or if the string returned is not valid as an entity name, then the conflicting declaration is simply ignored.
2. If the string returned is a valid entity name not matching an already existing entity, then that name is used for the new entity declaration and all references to that entity within the document are changed to the new name.
* 
If hook returns the name of an entity that is already declared, it is treated the same as if a blank string is returned. To avoid this, the hook should verify that the name being returned has not already been used. The built-in function entity_exists can be used to do this.