Translatedom() – Adobe Extending Dreamweaver CS4 User Manual
Page 350

344
EXTENDING DREAMWEAVER CS4
Data translators
6
The regExps string specifies a regular expression that you can check. The array should contain the same number of
regExps elements as are specified in nRegExps, and at least one of the regExps elements must match a piece of the
document’s source code before the translator can act on a file.
7
The runDefault string specifies when this translator executes. The following list gives the possible string values:
Note: 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 step 6.),
the effect is the same as setting
"noFiles"
.
8
The priority string 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 the 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 the
getTranslatorInfo()
function 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] = "