Two basic formats and file headers for WML Learning _WML tutorial

Source: Internet
Author: User
Basic format and file headers
General format for WML files:

<?xml version= "1.0"?>
<! DOCTYPE WML public "-//wapforum//dtd WML 1.1//en" "Http://www.wapforum.org/DTD/wml_1.1.xml" >
<wml>
<access/>
<meta..../>
<card>
Some contents ...
</card>
<wml>

The structure looks similar to an HTML file, and for each deck, the following type declarations must be specified at the beginning of the document:
<?xml version= "1.0"?>
<! DOCTYPE WML public "-//wapforum//dtd WML 1.1//en" "Http://www.wapforum.org/DTD/wml_1.1.xml" >
Pay attention to the case of letters. For a deck, its file size is best not to exceed 1.2K.

<wml> tags, like
Like HTML
<access domain= "domain" path= "/path"/> Equivalent to the <BASE> tag in HTML, specifying the access control information for the deck, which uses two optional properties, domain to specify the field, and the default value is the current domain. Path is used to specify paths, and the default value is "/", that is, the root directory. Because <access> is used alone, so use/end, later for similar situation no longer repeat.

The <meta property content= "value" scheme= "format" forua= "True|false"/> and similar in HTML, provides meta information for the deck. Properties are required, including three scenarios
Name= "name" up. Link server ignores meta data
http-equiv= "name" up. Link server converts meta data to HTTP response headers (same as HTML)
User-agent= "Agent" up. Link Server directly passes meta data to mobile devices, and the content attribute is also required, depending on the attribute. The scheme attribute is not currently supported. Forua is an optional attribute that specifies whether the,<meta> label is removed by the intermediary agent before the WML file is uploaded to the client (because the protocol for the transfer may change) and the default value is False.

Currently supported Meta data:
<meta http-equiv= "Cache-control" content= "max-age=3600"/> Specifies the storage time period for deck in the phone's memory cache, which defaults to 30 days (unless memory runs out), The mobile phone is invoked directly from the cache for the deck accessed. If the information is time-sensitive, you can use Max-age to specify the lifetime of the deck in the cache, the smallest unit is seconds, and if you specify 0, each time you need to call the deck by connecting to the server.

<meta user-agent= "Vnd.up.markable" content= "false"/> and <meta user-agent= "Vnd.up.bookmark" content= "specified URL"/ > Bookmark features similar to normal browsers. When a user bookmarks a card, the mobile browser first records the card with a tag, which defaults to the title attribute in the <card> tag (which is discussed later), and then opens the URL that is logged when the user chooses the bookmark. But because in the default case, the hand opportunity records all the deck, therefore, the general <meta> is used to make the handset not to record the current URL, namely
<meta user-agent= "Vnd.up.markable" content= "false"/>. In addition, if you want to specify a URL that is different from the current dreck for the bookmark, use the <meta user-agent= "Vnd.up.bookmark" content= "specified URL".

A deck can contain multiple card, each card content may be more than one screen display, pay attention to deck,card and screen display the relationship between the scope. A card with <card> and </card> included. <card> can contain the following optional properties:
<card id= "name" title= "label" newcontext= "false" ordered= "true" onenterforward= "url" onenterbackward= "url" ontimer = "url" >
The *id property is used to specify the name of the card, which can be used to jump between the card, which is equivalent to <a name= "Jumphere" in HTML when jumping within the page.
The *title property is used as a marker for a bookmark, which generally does not appear on the screen.
*newcontext property, the default value is False, to indicate that when you jump to this card, the phone is not to clear the previously retained information, including variables, the history of the stack, reset mobile phone status.
*ordered property, the default value is True, indicating whether the contents of the card are displayed in a fixed order or by the user's choice. This is different from HTML, the contents of the card page can be displayed in a certain order, the default is shown in a linear order, that is, in the order of the Code, however, note that the following three labels must be written in the following order <onevent> <timer> <do (This is related to the "event" to be told later). This is done in order to facilitate the form, when the ordered set to True, if the contents of a form can not be displayed in a screen, divided into multiple screen display; When ordered is set to false, the phone can display a summary card to summarize the valid options. The user can select form options from which to fill out.
The *onxxx property, similar to the OnXxx property in an HTML tag, is used to catch an event, to perform the specified action (Task) When the event is triggered, and to turn 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.