doc_new_stylesheet_association
doc_new_stylesheet_association(doc, params[])
This function creates a new stylesheet association for document doc with the attribute values specified by the associative array params where the keys of the array elements indicate the attribute name. Valid keys are href, type, title, media, charset, alternate. There must be elements for href and type. Others can be omitted. The href element should contain a relative path name, an absolute path name, or an http://URL. Arbortext Editor processes media values of Editor, Print/PDF, and screen. The screen media type is used to designate the HTML file stylesheet.
For example, the following function creates a new stylesheet association:
function add_ss_association(doc = current_doc())
{
local params[];
params["href"] = "htmlhelp.xsl";
params["type"] = "text/xsl";
if (!doc_new_stylesheet_association(doc, params))
{
response("Bad call to doc_new_stylesheet_association in " . caller());
return 0;
}
return 1;
}
If doc is not valid, or if params does not include elements for href and type, the function returns 0. Otherwise, it returns the resulting number of stylesheet associations.
If params includes elements with keys other than those listed above, those elements are silently ignored. There is no validation of the contents of any of the params elements.