WAP Note 1

Source: Internet
Author: User
Tags cdata

WML Basics
WML ---- wireless Markup Language
WML is a subset of XML. The WML file is named *. WML. WML files must meet the rules of XML documents.
WML documents are usually interpreted using an XML interpreter.

WML document editing Environment
Editor --- WML itself is text, so any text editor can complete it.
Simulator --- Nokia Ericsson Motorola and so on.
Graph conversion-create an image suitable for WAP, pic2wbmp.
Character conversion-Chinese Character <--> Unicode UTF-8.

WML file structure
A WML document page is usually called a desktop (deck), which is composed of a group of connected cards.
When a mobile device accesses a WML page, all the cards on the page are downloaded to the WAP device. The switch of the card is handled by the built-in phone device, and the information is no longer retrieved from the server.
Card can contain text, tags, links, input control, tasks, images, and so on.

The document is included in the following format:
Entity -- <XML>... </XML>
Card -- <card>... </card>
Text -- <p>... </P>

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">
<P>
Hello world!
</P>
</Card>
</WML>

The result is as follows:
------ Hello ------
Hello world!

WML character set:
WML is a subset of XML and inherits the XML Character Set settings.
The default character set for WML documents is the UTF-8.
There are two ways to display Chinese:
1. the character set specified earlier, but not currently supported. It is said that CDMA mobile phones are basically supported;
<? XML version = "1.0" encoding = "gb2312"?>
2. Use UnicodeCodeTo represent Chinese characters:
<B> & # x901a; & # x8baf; & # x5f55; </B>
Representative:
Address book

WML elements: tags and attributes
Because the tag will reduce the communication speed of the WAP device, only a small portion of the WML standard is used, most of which are text.
The labels used for tables and images are basically ignored.

<Tag> content </Tag> example: <p> Hello world! </P>
Or
<Tag/> example: <br/> and <go href = "# Done"/>

WML also supports marking attributes. The property is not displayed on the screen.

Both the WML tag and attribute values are case-sensitive (<XML> and <XML> are different), and the tag must end strictly according to the XML standard.
WML requires that the attribute value be enclosed in double quotation marks or single quotation marks. Single quotation marks can be placed in attribute marks or double quotation marks.
The character can also be the attribute value.

WML comments
Annotation formats supported by XML:
<! You can not see this missage --->
WML does not support annotation of nested elements.

Link (URL)
WML external reference is the same as HTML
Http://www.wap86.net/great.wml or
Http://www.wap86.net/great.wml#login
If it is an internal reference and next is a card in the current deck, you can use this method:
# Next
There are two WML elements that provide links: <go> and <anchor>.

CDATA
XML supports the concept of CDATA and displays text information that does not need to be interpreted.

]>
the browser window displays the following content:

This is data

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.