Specifications
Data Translators 227
7 runDefault specifies when this translator executes. The following table lists the possible values:
If you set
runDefault to "byExtension" but do not specify any extensions (see step 4), the
effect is the same as setting
"allFiles". If you set runDefault to "byExpression" but do
not specify any expressions (see
regExps, above), the effect is the same as setting "noFiles".
• priority specifies the default priority for running this translator. The priority is a number
between
0 and 100. If you do not specify a priority, the default priority is 100. The highest
priority is
0 and 100 is lowest. When multiple translators apply to a document, this setting
controls the order in which the translators are applied. The highest priority is applied first.
When multiple translators have the same priority, they are applied in alphabetical order by
translatorClass.
Example
The following instance of getTranslatorInfo() gives information about a translator for
server-side includes:
function getTranslatorInfo(){
var transArray = new Array(11);
transArray[0] = "SSI";
transArray[1] = "Server-Side Includes";
transArray[2] = "4";
transArray[3] = "htm";
transArray[4] = "stm";
transArray[5] = "html";
transArray[6] = "shtml";
transArray[7] = "2";
transArray[8] = "<!--#include file";
transArray[9] = "<!--#include virtual";
transArray[10] = "byExtension";
transArray[11] = "50";
return transArray;
}
Value Description
"allFiles" Sets the translator to always execute
"noFiles" Sets the translator to never execute
"byExtension" Sets the translator to execute for files that have one of the file extensions that are
specified in the extension
"byExpression" Sets the translator to execute if the document contains a match for one of the
specified regular expressions
"bystring" Sets the translator to execute if the document contains a match for one of the
specified strings