Extended DW: Custom third-party tag parsing

Source: Internet
Author: User
Tags html tags dreamweaver

Extended Dreamweaver: parsing custom third-party tags

As Dreamweaver plug-ins have been developed recently, there are very few Chinese materials and their English skills are poor, you can't help but feel dizzy when viewing the English documents. It was imperative to translate some important content into Chinese, so it was quite refreshing. This excerpt is from Extending Dreamweaver 8, which is included in Dreamweaver 8. For the translation, see The Dreamweaver 4 Chinese help translated by chivalrous Island. But to be honest, I doubt that some part of the help is translated by software such as Kingsoft fast translation, which is hard to read than English.

Server technologies, such as ASP, Macromedia ColdFusion, JSP, and PHP, use special non-HTML syntax in HTML files. The server creates and provides HTML content based on these codes. When Dreamweaver detects non-HTML tags, Dreamweaver calls the definition files of third-party tags to compare them. These files specify how Dreamweaver reads and displays these tags.

For example, in addition to the standard HTML language, ASP files also contain ASP code for server parsing. The ASP code looks like an HTML tag. It is marked by a pair of tags starting with <% and disabled %>. In the Configuration/ThirdPartyTags folder of Dreamweaver, there is a folder named Tags. xml file, which describes various third-party tag specifications, including ASP, and defines how Dreamweaver displays the code. Using this method, ASP code has been standardized in Tags. xml, so Dreamweaver will not try again in <% ...... %>. However, in the design view, an icon is displayed to indicate that this is ASP code. You can define your own tags and create a new tag library file for each set of tags to specify how Dreamweaver reads and displays your tags.

Note: This section describes how to define Dreamweaver to display a custom tag, but does not describe how to edit the content or attributes of the custom tag. For details about how to create an attribute checker to check and modify the attributes of a custom tag, see the property checker for relevant information.

Each tag library file defines the names, types, content modes, Display specifications, and icons of one or more custom tags. You can create any number of tag library files, but they must be in the Configuration/ThirdPartyTags folder for Dreamweaver to read and process. The tag library file uses the. xml file extension.

Tip: If you are working on several different websites at the same time (assuming you are a freelancer), you can define all the labels in one file, and put it on a special site. When someone else maintains this site in the future, you can hand over the tag library including the custom icon and attribute checker to it.

You need to use an XML tag named tagspec to define a tag specification. For example, the following code indicates a label rule named happy.

<Tagspec tag_name = "happy" tag_type = "nonempty" render_contents = "false" content_model = "marker_model" icon = "happy.gif" icon_width = "18" icon_height = "18"> </ tagspec>

You can use tagspec to define two types of labels :. The "happy" tag example of a common tag in HTML format is a common tag in HTML format. It starts with the

. Tags defined by a string. Tags defined by a string start with a string and end with another string. They are similar to empty HTML tags (such as img, because they neither contain content nor close tags. If happy is also a string-defined tag, its definition specification must contain start_string and end_string attributes. ASP labels are all string-defined labels. They start from <%, end to %>, and are not closed.

The following information lists the attributes and valid values of the tagspec tag. An attribute with an asterisk (*) indicates a tag that is not applicable to character strings. An optional attribute is identified by braces, other attributes that do not use braces are required.

<Tagspec>

Description

</

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.