A Tag Library consists of a single root file, the TagLibraries.vtm file, that lists every installed tag, plus a .vtm (VTML) file for each tag in the Tag Library. The TagLibraries.vtm file functions as a table of contents and contains pointers to each individual tag's .vtm file. The following illustration shows how organizes the .vtm files by markup language
HomeSite users will recognize the .vtm file structure, but they should be aware that does not use .vtm files in exactly the same way as HomeSite. The most important difference is that contains its own HTML renderer that displays extension UIs, so the .vtm files are not used in the GUI rendering process.
The following example illustrates the structure of the TagLibraries.vtm file:
<taglibraries> <taglibrary name="Name of tag library" doctypes="HTML,ASP-JS,ASP-VB" tagchooser="relative path to TagChooser.xml file" id="DWTagLibrary_html"> <tagref name="tag name" file="relative path to tag .vtm file"/> </taglibrary> <taglibrary name="CFML Tags" doctypes="ColdFusion" servermodel="Cold Fusion" tagchooser="cfml/TagChooser.xml" id="DWTagLibrary_cfml"> <tagref name="cfabort" file="cfml/cfabort.vtm"/> </taglibrary> <taglibrary name="ASP.NET Tags" doctypes="ASP.NET_CSharp,ASP.NET_VB"¬ servermodel="ASPNet" prefix="<asp:" tagchooser="ASPNet/TagChooser.xml"¬ id="DWTagLibrary_aspnet"> <tagref name="dataset" file="aspnet/dataset.vtm" prefix="<mm:dataset"/> </taglibrary> </taglibraries>The taglibrary tag groups one or more tags into a Tag Library. When you import tags or create a new set of tags, you can group them into Tag Libraries. Typically, a taglibrary grouping corresponds to a set of tags that are defined in a JavaServer Pages (JSP) TLD file, an XML document type definition (DTD) file, an ASP.Net name space, or some other logical grouping.
The following table lists taglibrary
| taglibary.name | Used to refer to the Tag Library in the user interface. | Mandatory |
| taglibrary.doctypes | Indicates the document types for which this library is active. When active, library tags appear in the Code Hints pop-up menu. Not all Tag Libraries can be active at the same time because name conflicts can occur (for example, HTML and WML files are incompatible). | Mandatory |
| taglibrary.prefix | When specified, tags within the Tag Library have the form taglibrary.prefix + tagref.name For example, if the taglibrary.prefix is "<jrun:" and the tagref.name is " if" then the tag is of the form " <jrun:if" . This can be overridden for a particular tag. | Optional |
| taglibrary.servermodel | If the tags in the Tag Library execute on an application server, servermodel identifies the server model of the tag. If the tags are client-side tags (not server-side tags), the servermodel attribute is omitted. servermodel is also used for Check Target Browsers. | Optional |
| taglibrary.id | This can be any string that is different from the taglibrary.ID attributes of other Tag Libraries in the file. The ID attribute is used by the Extension Manager, so the MXP files can insert new <taglibrary> and the tags files into the TagLibraries.vtm file. | Optional |
| taglibrary.tagchooser | A relative file path to the TagChooser.xml file that is associated with this Tag Library. | Optional |
| tagref.name | Used to refer to the tag in the user interface. | Mandatory |
| tagref.prefix | Specifies how the tag appears in Source view. When used, tagref.prefix determines the prefix of the current tag. When the attribute is defined, it overrides the value specified for taglibrary.prefix . | Optional |
| tagref.file | References the VTML file for the tag. | Optional |
Because the tagref.prefix attribute can override taglibrary.prefix , the relationship between the two attributes can be confusing. The following table shows the relationship between the taglibrary.prefix and tagref.prefix attributes:
| No | No | ' <' + tagref.name |
| Yes | No | taglibrary.prefix + tagref.name |
| No | Yes | tagref.prefix |
| Yes | Yes | tagref.prefix |
To define tags, MX uses a modified version of 's VTML file format. The following example demonstrates all the elements that MX must use to define an individual tag:
<tag name="input" bind="value" casesensitive="no" endtag="no"> <tagformat indentcontents="yes" formatcontents="yes" nlbeforetag ¬ nlbeforecontents=0 nlaftercontents=0 nlaftertag=1 /> <tagdialog file = "input.HTM"/> <attributes> <attrib name="name"/> <attrib name="wrap" type="Enumerated"> <attriboption value="off"/> <attriboption value="soft"/> <attriboption value="hard"/> </attrib> <attrib name="onFocus" casesensitive="yes"/> <event name="onFocus"/> </attributes> </tag>The following table lists the attributes that define tags:
| tag.bind | Used by the Data Binding panel. When you select a tag of this type, the BIND attribute indicates the default attribute for data binding. | Optional |
| tag.casesensitive | Specifies whether the tag name is case-sensitive. If the tag is case-sensitive, it is inserted into the user's document using exactly the case that is specified in the Tag Library. If the tag is not case-sensitive, it is inserted using the default case that is specified in the Code Format tab of the Preferences dialog box. If casesensitive is omitted, the tag is assumed to be case-insensitive. | Optional |
| tag.endtag | Specifies whether the tag has both a beginning and an end tag. For example, <input> has no end tag; there is no matching </input> tag. If the end tag is optional, the ENDTAG attribute should be set to Yes . | Optional |
| tagformat | Specifies the tag's formatting rules. In versions before MX, these rules were stored in SourceFormat.txt. | Optional |
| tagformat.indentcontents | Specifies whether the contents of this tag should be indented. | Optional |
| tagformat.formatcontents | Specifies whether the contents of this tag should be parsed. This attribute is set to No for tags such as <SCRIPT> and <STYLE> , for which content is something other than HTML. | Optional |
| tagformat.nlbeforetag | The number of newline characters to insert before this tag. | Optional |
| tagformat.nlbeforecontents | The number of newline characters to insert before the contents of this tag. | Optional |
| tagformat.nlaftercontents | The number of newline characters to insert after the contents of this tag. | Optional |
| tagformat.nlaftertag | The number of newline characters to insert after this tag. | Optional |
| attrib.name | The name of the attribute, as it appears in the source code. | Mandatory |
| attrib.type | If omitted, attrib.type is "text" . It can have the following values: TEXT —free text content ENUMERATED —a list of enumerated values COLOR —a color value (name or hex) FONT —font name or font family STYLE —CSS styles attribute FILEPATH —a full file path DIRECTORY —a directory path FILENAME —filename only RELATIVEPATH —a relative representation of the path FLAG —an ON/OFF attribute that contains no value | Optional |
| attrib.casesensitive | Specifies whether the attribute name is case-sensitive. If the CASESENSITIVE attribute is missing, the attribute name is case-insensitive. | Optional |
Note: In versions before MX, tag information is stored in the Configuration/TagAttributeList.txt file.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117