Working with Tag Definitions

Tag definitions are the source of information for Tag Editors, Tag Insight, and Tag Inspector in HomeSite. These are the namespaces for which tag definitions are installed: XHTML, HTML, CFML, VTML, JSP, Java, JRUN, WML, HDML, SMIL, IMFL, RTML, and Custom.

About namespace precedence

A version of a markup language (or namespace) can have a tag with the same name as a tag in another namespace. For example, both the JRun and Java namespaces contain a servlet tag. To avoid conflicts, the tag definitions for different namespaces are installed in different directories, in the \Extensions\TagDefs directory under the application root directory.

When you use a Tag Editor or Tag Inspector, or Tag Insight is enabled, HomeSite needs to know which tag definition to use. The list in the Options > Settings > Tag Definitions Library pane represents the order in which HomeSite searches the directories when looking for a tag definition.

For example, if you type <region> in a document, right-click it and choose Edit Tag, the SMIL Tag Editor appears, because no other directory contains a <region> tag. On the other hand, if you edit a <servlet> tag, either the Java or JRun version of the Tag Editor could appear. If JRun is higher on the namespace list than Java, then the program uses the JRun version of the servlet tag definition, without continuing its search to discover the Java version.

There are two ways to manually override these defaults while working in the editor:

Setting namespace precedence

This section explains how to set the order in which the program searches namespace directories for a tag definition. For more information, see "About namespace precedence".

To set the priority of namespaces:

  1. In the Options > Settings > Tag Definitions Library pane, click the Up and Down buttons as necessary to set the list in the appropriate order.

    The namespace on top receives the highest priority.

  2. If you do not want to search a namespace at all, clear the Enabled option for it.
  3. If you want the current document's type to receive the highest priority regardless of the precedence set in this pane, select Current document's namespace receives highest priority.

    For information about how a document's namespace is determined, see "How a language is detected".

  4. If you need the namespace to be treated as an XML application; for example, to disallow minimized boolean attributes such as <dl compact> (instead of <dl compact="compact">), then select XML Based for the namespace.
  5. Click Apply.

You can click Reset to Defaults at any time to reset the list to its default values.

Editing tag definitions

You can change a tag's definition from the Tag Inspector, but the preferred method for changing a tag definition is to edit the VTM file directly using VTML tag editors.

To edit a tag definition using VTML tag editors:

  1. Open the VTM file from the appropriate language folder in \Extensions\TagDefs.
  2. Right-click a tag, and select Edit Tag to change its attributes and values.

This method supports tag editors, Tag Inspector, Tag Insight, and Tag Tips, and also ensures that Large Fonts display properly on user systems.

To edit a tag definition using Tag Inspector:

  1. Click the Edit Tag Definitions button to open the Tag Definitions Library dialog box. The left pane lists all of the installed languages. You can edit the definitions list by using the Add and Remove buttons.
  2. Expand a language entry to view individual tags. When you select a tag, the attributes and other components defined in its VTM file appear in the tabbed pane.
  3. Make changes in the tag definition fields and click Done to save the changes.

This method has limitations, and it might cause the tag's editor to not work properly. Be sure to backup the VTM file before making changes.

To create a tag definition, do one of the following:

To add online help for the tag, create an HTML file containing the help text and save it with the tag name in the appropriate language folder in \Extensions\Docs.

Comments