WML learning (2): Basic pattern and file header

Source: Internet
Author: User
Basic pattern and general pattern of wml files in the file header :? Xmlversion = "1.0 "?! DOCTYPEwmlPUBLIC "-// WAPFORUM // DTDWML1.1 //" http://www.wapforum.org/DTD/wml_1.1.xml "wmlheadaccess/meta... basic pattern and file header
The general structure of wml files:









Some contents...



The structure looks similar to HTMl files. for each DECK, the following type declaration must be specified at the beginning of the document:


Pay attention to the case sensitivity of letters. For a DECK, the file size should not exceed 1.2 KB.

   Tag and in HTMLThe same label indicates that this is a wml deck, which has an optional xml: lang attribute to define the language of the document, such The language of the presentation document is Chinese.

Same as HTMLThe tag contains the related information of the DESK.A tag can contain one or more tags. Label.

Equivalent Tag to specify the access control information of the DECK. it uses two optional attributes: domain to specify the domain. the default value is the current domain, and path to specify the path. the default value is '/', that is, the root directory. Because it is used separately, it must end with/. we will not repeat similar cases in the future.

   Similar to that in HTML, the meta information of the DECK is provided. Attribute is required, including the following three conditions
Name = 'name' UP. Link Server neglected meta data
Http-equiv = 'name' UP. Link Server converts meta data into an HTTP response header (same as HTML)
User-agent = 'agent' UP. Link Server directly transmits meta data to the mobile phone device. the content attribute is also required and its content depends on the property. The scheme attribute is not yet supported. Forua is an optional attribute, which specifies that before the wml file is uploaded to the client, Whether the tag is deleted by the intermediate proxy (the transfer protocol may change). The default value is false.

Currently supported meta data:
   Specify the storage period of the DECK in the cell phone memory cache. the default value is 30 days (unless the memory is exhausted). during this period, the mobile phone calls the visited DECK directly from the cache. If the information is time sensitive, you can use max-age to specify the lifetime of the DECK in the cache. the minimum unit is seconds. if it is specified as 0, you need to connect to the server to call the DECK each time.

   And Similar to the bookmarks of common browsers. After a user bookmarks a CARD, the mobile browser first uses a tag to record the CARD. the default tag is The title attribute in the tag (which will be discussed later). after the user selects the bookmark, the browser will open the recorded URL. However, by default, the mobile phone records all the DECK records. Used to prevent the mobile phone from recording the current URL, that is
. In addition, if you want to specify a URL different from the current DRECk for the bookmarks, use .

A deck can contain multiple cards. the content of each CARD may be displayed on more than one screen. pay attention to the relationship between DECK, CARD, and display category. Use a CARD And Include. It can contain the following optional attributes:

* The id attribute is used to specify the name of a CARD. it can be used to redirect between cards. This attribute is equivalent to being used to redirect pages in HTML.
* The title attribute is used to mark Bookmarks. it is generally not displayed on the screen.
* Newcontext attribute. the default value is false. it is used to indicate whether the phone needs to clear the previously reserved information, including variables, historical records in the stack, and reset the mobile phone status when the phone jumps to this CARD.
* The ordered attribute. the default value is true, indicating whether the content in the CARD is displayed in a fixed order or by user selection. This is different from HTMl. the content on the CARD page can be displayed in a certain order. by default, the content is displayed in a linear order, that is, in the code order. however, pay attention to the following, the following three tags must be written in the following order:     , (This is related to the "events" to be discussed later ). This is done to facilitate table filling. when ordered is set to true, if the content of a form cannot be displayed on one screen, it is divided into multiple screens; when the value of ordered is set to false, the mobile phone can display a summary CARD to summarize the valid options. you can select the form options to fill in.
* The onXXX attribute is similar to the onXXX attribute in the HTML tag to capture events. When an event is triggered, it performs the specified hold (task). here, it is switched to a URL.

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.