Accessibility

TechNote (Archived)

Dreamweaver adds translator code to document source code

Issue


In certain situations, Dreamweaver MX translator code is added to the source code of a document.The issue appears after saving and re-opening the page, or opening a page edited in an external editor.

For example, the following code in a page:

 <script>
		
<!--#include -->
</script>

is converted to:

 <script>
		
<MM:BeginLock translatorClass="MM_SSI" type="ssi_comment" orig="%3C!--#include file=%22inc/include.inc%22 --%3E" fileRef="inc/include.inc" depFiles="file:///C|/MySites/asp/inc/include.inc">#993333
<MM:EndLock>
</script>

Reason


The code inserted into the page is Dreamweaver's internal translator code. This code is used to translate source code for rendering the design view. In certain circumstances Dreamweaver does not complete the translation process, and the intermediate translator code is erroneously left behind in the source code.

There are two known situations when this will occur:

A server side include file is called within <script> and </script> or <style> and </style> tags (see solution 1).
A dynamic page is viewed in"code view only" mode (see solution 2).

Note:This behavior occurs with both HTML include statements (as above) and ColdFusion includes (<cfinclude>).This is a known issue with Dreamweaver.

Solution 1
Include the <script> and </script> or <style> and </style> tags inside the included file.
Be sure the script or style code block is within or preceded by comment tags:
 <script>
		
<!--
<!--#include -->
//-->
</script>
Solution 2
This situation arises when either the MMDocumentTypes.xml file is modified, or the "Open in Code View" preference (in the File Types/Editors preference category) is modified.

If MMDocumentTypes.xml is modified to treat a particular file extension as a dynamic document, and the same file extension is listed in the "Open in Code View" preference, the translator code issue will be experienced.

In some situations developers wish to treat certain file types as dynamic documents in order to enable color coding in code view. For example, to have files with .inc extensions treated as ASP files, the following modification can be made to MMDocumentTypes.xml (modifications are in red).

 <documenttype id="ASP-VB" servermodel="ASP VBScript" internaltype="Dynamic" winfileextension="asp,inc" macfileextension="asp,inc" > 

Note:Always make back-up copies before modifying any Dreamweaver application files. For more information on modifying the MMDocumentTypes.xml file, please refer to Changing and adding file extensions recognized by Dreamweaver MX (TechNote 16410).

If such a modification is made, and the new file extension is also listed in the "Open in Code View" preference (as ".inc" is by default), the translator code issue will occur. To resolve the issue, remove the file extension from the "Open in Code View" preference.

In other situations, developers may wish to add a dynamic file extension to the "Open in Code View" preference. However, doing so will cause the translator code isue to appear. This includes Dreamweaver's default dynamic page extensions (.cfm, .cfml, .cfc, .asp, .aspx, .ascx, .jsp, .jst, .php, .php3), as well as any added to MMDocumentTypes.xml as described above.

The solution in this situation is to remove the dynamic file extension from the "Open in Code View" preference.

Note:When the corrective measures explained above are taken, the file with translator code will repair itself the next time the file is opened. Be sure to quit Dreamweaver and restart after modifying configuration files and application preferences.

Additional information
The above information discusses known issues with translator code. If you are experiencing the translator code insertion issue and your situation is not described above, or the issue is not resolved with the above instructions, please let us know. Submit your information using the online support request form, or if you are not eligible for support, the online bug report form.

Please provide the following information.

The page extension of the file which contains translator code.
The server model defined for the site.
Sample code, before and after translator code is added. Be sure to attempt to duplicate the issue on a new page without extraneous content, and supply the bare-bones example.
Identify any modifications made to MMDocumentTypes.xml (copy the relevant portion of the file in your message).
The file extensions listed in the "Open in Code View" preference.
If the issue appears in relation to a Server Side Include, identify the Invisible Element preference for "Comments" and "Show Contents of Included File".


AlertThis content requires Flash

To view this content, JavaScript must be enabled, and you need the latest version of the Adobe Flash Player.

Download the free Flash Player now!

Get Adobe Flash Player

Creative Commons License

Search Support


Document Details

ID:tn_16511
Browser:Chrome
Internet Explorer
Netscape
Opera
Safari
Firefox
Database:DB2
Informix
MySQL
Oracle
SQL Server
Sybase
MS Access

Products Affected: