What is WML?

Source: Internet
Author: User

 

WML (Wireless Markup Language) is a scripting language that consumes less memory and CPU time than the content written in HTML, this makes WML more user-friendly for Wan and mobile devices. Integrated mobile devices (smart phones, smartphones), such as Handspring Treo 600, palm tunsten W, or similar to Motorola MPX
200 these well-known phone-based devices often benefit from user preferences over traditional PDAs.

I. Introduction  

WML (Wireless markup language-
Wireless Markup Language ). It is a markup language inherited from HTML, but WML is based on XML, so it is stricter than HTML. WML is used to create and display on WAP
Page in the browser. Pages written in WML are called decks. Decks is constructed as a set of cards. This descriptive language is the same as the HTML language we often hear. It belongs to the XML language family. The syntax of WML is the same as that of XML. WML is a subset of XML. The content written in HTML can be read in IE, Netscape, and other browsers on our PC, WML language files are specially used for display on wireless terminal display devices such as mobile phones. They can also provide users with human-computer interaction interfaces, accept the query and other information entered by the user, and then return the final information he wants to obtain to the user.

Ii. Detailed Description

WML (Wireless Markup Language) is a scripting language that consumes less memory and CPU time than the content written in HTML, this makes WML more user-friendly for Wan and mobile devices. Integrated mobile devices (smart phones, smartphones), such as Handspring Treo 600, palm tunsten W, or similar to Motorola
MPX 200 is a well-known phone-based device. Their advantages over traditional PDAs often come from users' preferences. Do users prefer to carry a multi-functional device that integrates mobile phone and PDA functions, or a mobile phone and a PDA? Integrating sound and data functions into a device has some attractive benefits, such as calling a number from the address book, there is the phone number of all your contacts, not just the number you typed on the keyboard, because the phone number can be synchronized with your computer. In addition, well-known phones will provide mature operating systems,
For example, Palm OS, Symbian, Linux, or windows are associated with mobile devices that can access the Internet. This provides a platform for companies to move their enterprise applications, allow users in the region to access the latest data. Traditional mobile phone screens based on proprietary operating systems are too small to display meaningful data. PDAs without wireless Internet access are often unable to fully comply with technical specifications, this prevents them from effectively Processing Mobile Data.

Iii. WMLScript

WML uses WMLScript to run simple code on the client. WMLScript is a lightweight JavaScript language. However, WML scripts are not embedded in the WML page. The WML page only contains scripts
URL reference. Before running the WML script on the WAP browser, it must be compiled into Byte encoding on the server. The WML file itself is a text file, so editing is not a problem. You can use the proper editor. Of course, because the current browser (Operabrowser can) Cannot be displayed.
WML pages, and we cannot always perform tests on mobile phones (the speed is too slow), so we need a simulator. Now mobile phone manufacturers such as Nokia, Ericsson, and Motorola all produce corresponding products. You only need to download them. Of course, in addition to the simulator, you also need a graphical converter (used to make drawing files in WAP format), a character Transcoder (Chinese Character <=> Unicode), and so on. The tools and forum pages on this site are described.

Iv. WML file structure

A WML page is usually called a desktop (deck), which is composed of a group of cards that are connected to each other. When a mobile phone accesses a WML page, all the cards on the page will be downloaded from the WAP Server to the device. The switch between cards is handled by a computer built into the phone, and no information needs to be retrieved from the server. Card can contain text, tags, links, input control, tasks, images, and so on. Cards can be linked to each other.

The object of the document is included in <WML>... </WML> MARK. Each card in the document is included in <card>... </card> mark, and the actual text section is included in...

Marking.

Simple Example:

<? XML version = "1.0"?>

<! Doctype WML public "-// wapforum // dtd wml 1.1 // en"

"Http: // www. Wapforum. Org/DTD/wml_1.1.xml ">

<WML>

<Card id = "hello" Title = "hello">

Hello world!

</Card>

</WML>

The result is as follows:

------ Hello ------

Hello world!

The specific explanations of the components in deck are described in other sections of this tutorial.

5. WML Character Set

WML is a subset of XML and inherits the character set settings of XML. The default character set for WML documents is the UTF-8.

There are two ways to display Chinese characters. The simplest way is to use encoding in the Document Header, that is, change the first line:

<? XML version = "1.0" encoding = "gb2312"?>

However, it is frustrating that some mobile phones and simulators do not support this method (which will happen in the future). So currently, 2nd methods are more common: Do not change character set settings, however, Unicode is used to represent Chinese characters when writing Chinese characters.

The sample code is as follows:

<? Header ("Content-Type: text/vnd. WAP. WML; charset = UTF-8"); echo "<? XML version = \ "1.0 \"?> ";?> <! Doctype WML public "-// wapforum // dtd wml 1.1 // en" http://www.wapforum.org/DTD/wml_1.1.xml "> <WML> 

 

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.