doc_get_stylesheet_association
doc_get_stylesheet_association(doc, i, params[])
This function gets information about a stylesheet association. It returns data for the ith stylesheet association of document doc in associative array params where the keys of the array elements are href, type, title, media, charset, and alternate, corresponding to the attributes of the stylesheet processing instruction. The href element will contain a relative path name, an absolute path name, or an http://URL.
For example, the following ACL function would display the information for each existing stylesheet association for a document:
function show_ss_associations(doc = current_doc())
{
local n = doc_num_stylesheet_associations(doc);
if (n < 0)
{
response("Bad doc $doc passed to show_ss_associations from " . caller(1));
return 0;
}
local i;
eval "Stylesheet associations:" output=*
for (i=1; i <= n; ++i)
{
local params[];
if (!doc_get_stylesheet_association(doc, i, params))
{
response("Bad call to doc_get_stylesheet_association in " . caller());
return 0;
}
eval "href =", params["href"], " type =", params["type"], \
" title =", params["title"], \
" media =", params["media"], " character set =", params["charset"], \
" alternate =", params["alternate"] output=>*
}
return 1;
}
If doc is not a valid document identifier, or if there is no ith stylesheet association for doc, the function returns 0. Otherwise, it returns 1.
Related Topics