3.2. Prolog

Prolog refers to the first two lines of our "Hello World" WML example:

<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN" "http://www.wapforum.org/DTD/wml13.dtd">

Every WML document starts with the prolog. The first line is the XML declaration and the second line is the DOCTYPE declaration.

The prolog components are not WML elements and they should not be closed, i.e. you should not give them an end tag or finish them with />.

3.3. XML Declaration and Character Encoding

All WML documents are XML documents. So, there is an XML declaration at the start. The XML declaration specifies the XML version of the document. The character encoding of the document can also be specified here, like this:

<?xml version="1.0" encoding="UTF-8"?>

The above line states that the XML version of the WML document is 1.0 and the character encoding is UTF-8. If the character encoding of the WML document is UTF-8 or UTF-16, there is no need to declare the character encoding as it can be detected automatically.

Note that there should have no whitespace before the XML declaration. If not, some WAP browsers or WAP gateways cannot process the WML file.

Previous Page Page 3 of 50 Next Page

Feedback Form (Expand)

What do you think about this web page?

WML Tutorial - Table of Contents WML Tutorial - Contents at a Glance Preferences - Light mode / Dark mode Preferences - Do Not Show Ads Previous Page Next Page