WML (Wireless Markup Language - Wireless Markup Language). It is a markup language inherited from HTML, but WML is based on XML, so it is more stringent than HTML.
WML is used to create pages that can be displayed in the WAP browser. Pages written in WML are called DECKS. DECKS is constructed as a set of CARDS.
This description language is the same as the HTML language we often hear about, and both belong to the XML language family. The syntax of WML is the same as XML, which is a subset of XML.
We can read content written in HTML on our PC using browsers such as IE or Netscape, while files written in WML are specially used to display on some wireless terminal display screens such as mobile phones for people to read. They can also provide users with human-computer interaction interfaces, accept information such as inquiries entered by users, and then return the final information they want to obtain to the user.
[Edit this section]What is WMLScript?
WML Run simple code on the client using WMLScript. WMLScript is a lightweight JavaScript language. However, WML scripts are not embedded in WML pages. The WML page only contains references to the script URL. Before the WML script is run in the WAP browser, it needs to be compiled into byte encoding on the server.
Create a web page creation environment
WML files themselves are text files, so editing is not a problem, and you can use them with easy editors.
Of course, since the current browsers cannot display WML pages, and we cannot always test them on our phones (the speed is too slow), we need an emulator. Now mobile phone manufacturers such as NOKIA, ERICSSON, and MOTOROLA have produced corresponding products, and you just need to download them. Of course, in addition to the emulator, there is also a graphic production converter (used to create graphic files in WAP format), a character transcoder (Chinese characters <=> UNICODE), etc. The tools and forum pages of this site are explained.
WML file structure
WML pages are usually called desktops (DECKs), and are composed of a group of linked cards (CARDs). When a mobile phone accesses a WML page, all CARDs of the page are downloaded from the WAP server to the device. The switching between CARDs is handled by the phone's built-in computer, and there is no need to get information on the server. CARD can contain text, tags, links, input controls, tasks (TASK), images, etc. CARDs can be linked to each other.
The entity of the document is contained in the <wml>...</wml> tag, each CARD in the document is contained in the <card>...</card> tag, and the actual text paragraph is contained in the...
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 results are displayed as follows:
------ HELLO ------
Hello World!
The specific explanation of each component in DECK is explained in other parts of this tutorial.
WML character set
WML is a subset of XML, inheriting the character set settings of XML. The default character set for WML documents is UTF-8.
There are two ways to display Chinese. The easiest way is to use encoding at the head of the document, that is, change the first line to:
<?xml version=1.0 encoding=gb2312?>
However, it is disgusting that some mobile phones and emulators do not support this method (will in the future), so the second method is more common at present: do not change the character set settings, but use UNICODE to represent Chinese characters when writing Chinese, such as:
<b>Address List</b>
represent:
Contacts
WML elements: tags (Tags) and attributes
The main content of WML is text. Since markings will reduce the communication speed with handheld devices, only a small part of the WML standard is used. The markers used for tables and images are almost all excluded.
Like XML, in WML, all elements are placed in symbols < and > and contain a start flag, an end flag, and a content flag, or a control mark that uses its own end. Just like this:
<tag>Content</tag> For example: Hello World!
or
<tag/> For example:
and <go href=#done/>
WML also supports marking attributes in flags. An attribute is additional information for a flag. It is different from the content of an element and it is not displayed on the screen. Attributes are usually specified after the start flag of the element. As in the last example above.
Since WML is an application of XML, all WML tags and attributes are case sensitive (<wml> is completely different from <WML>), and all tags must end correctly. WML requires that the value of the attribute must be placed in double quotes or single quotes. Single quotes can be placed in attribute flags or double quotes. Characters can also be used as values for attributes.
WML Comments
XML supports such annotation format:
<!You can't see this sentence on your phone-->
These comments are not displayed in the browser.
WML does not support nested element annotations.
Link (URL)
The external reference method of WML is the same as HTML
http://www.itsalon.net/index.wml or
http://www.itsalon.net/index.wml#login
Internal reference, if next is a CARD in the current DECK, you can use this method:
#next
There are 2 WML elements that provide linking functions: <go> (see task) and <anchor> (see event).
CDATA
XML supports the concept of CDATA to display text that does not require interpretation. The following example uses the CDATA element to display WML command text in a WML page.
<! [CDATA [ <card name=bogus>this is data
</card> ] ]>
The browser window will display the following content:
<card name=bogus>this is data
</card>