Arbortext Command Language > Functions by Alphabetical Listing > stylesheet_list_add
  
stylesheet_list_add
stylesheet_list_add (path, use, doctype)
This function adds path to a list of stylesheet paths for the specified doctype and use. The stylesheet_get_list_doc function searches this list for valid stylesheets during the current Arbortext Editor session. Arbortext Editor verifies that the path specifies a stylesheet that supports the use.
Valid use types are any, htmlfile, htmlhelp, pda, print, pdf, web, wml, and xsl. If use is any, all .style, .xsl, and .fos files are returned.
For a stylesheet to be returned by stylesheet_get_list_doc, the use passed to stylesheet_get_list_doc must match the use passed to stylesheet_list_add.
The doc passed to stylesheet_get_list_doc must use the same doctype passed to stylesheet_list_add.
If you are using Arbortext Publishing Engine for publishing documents, the path must be specified by a URL or it will be ignored by Arbortext Editor. A stylesheet used for editing must always be specified using a local absolute or relative path.
An example for adding stylesheets using stylesheet_list_add:
# Let users select a stylesheet for a given "doc" and "use"
# from a list of stylesheets in their document and document
# type directories or by browsing; if they browse to select
# a stylesheet, include that stylesheet in the list the
# next time they ask for the same "use" with either the
# same document, or another document of the same document
# type.
# Valid "use" values are any of the Type attributes
# of publish elements in the document type's .dcf file,
# plus "editor"
function stylesheet_get(doc, use)
{
# First get list of stylesheets that we show by label;
#
# The list includes those valid for "use" in the
# document directory, document type directory, or
# that were previously selected for this use and
# document type;
local labels[], paths[], is_styler[];
local n = stylesheet_get_list_doc(labels, paths, is_styler, use, doc);
# Display this list to users, let them pick a stylesheet
# from the list or by browsing.
# NOTE: this function does not actually exist;
local path = stylesheet_pick(labels, paths, use);
# If users browsed to the stylesheet, add it to the
# list of stylesheets that stylesheets_get_list_doc
# will consider returning the next time;
stylesheet_list_add(path, use, doc_type(doc));
return path;
}
Related Topics
Stylesheet overview
Select Stylesheets dialog box
stylesheet_get_list_dir function
stylesheet_get_list_doc function
Associating a stylesheet with your document
Stylesheet association processing instruction