Specifications
Extending Dreamweaver MX 29
To provide localized strings, perform the following steps:
1 Place the following statement at the top of the document type definition file:
<?xml version="1.0" encoding="utf-8"?>
2
Declare the MMString name space in the <documenttypes> tag:
<documenttypes
xmlns:MMString="http://www.macromedia.com/schemes/data/string/">
3
At the location in the document type definition file where you want to provide a localized
string, use the
MMString:loadstring directive to define a placeholder for the localized string.
You can specify this placeholder in one of two ways:
<description>
<loadstring>myJSPDocType/Description</loadstring>
</description>
or
<description>
<loadstring id="myJSPDocType/Description" />
</description>
In these examples, myJSPDocType/Description is a unique string identifier that acts as a
placeholder for the localized string. The localized string is defined in the next step.
4 In the Configuration/Strings folder, create a new XML file (or edit an existing file)
that defines the localized string. For example, the following code, when placed in the
Configuration/Strings/strings.xml file, defines the
myJSPDocType/Description string:
<strings>
...
<string id="myJSPDocType/Description"
value=
"<![CDATA[JavaServer Page with <em>special</em> features]]>"
/>
...
</strings>
Note: String identifiers, such as myJSPDocType/Description in the preceding example, must be unique
within the Dreamweaver MX application. Dreamweaver, when it launches, parses all XML files within the
Configuration/Strings folder and loads these unique strings.
Rules for document type definition files
Dreamweaver MX lets document types that are associated with a server model share file
extensions. For example: ASP-JS and ASP-VB can claim .asp as their file extension. (For
information on which server model gets preference, see “canRecognizeDocument()” on page
217.)
Dreamweaver MX does not let document types that are not associated with a server model share
file extensions.
If a file extension is claimed by two document types where one type is associated with a server
model and the other is not, the latter document type gets preference. Suppose you have a
document type called SAM, which is not associated with a server model, that has a file extension
of .sam, and you add this file extension to the ASP-JS document type. When a Dreamweaver MX
user opens a file that has a .sam extension, Dreamweaver assigns the SAM document type to it,
not ASP-JS.