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 (ExpandCollapse)

What do you think about this web page?






(Optional) Please provide us more details. For example, suppose you select option 2 above, can you tell us specifically what information is missing? You can also suggest anything that can help us improve this web page.

(Optional) Your name:

(Optional) Your email address:

Please enter again to confirm:

Due to the amount of messages we received, we may not be able to reply to all messages.

A button for going back to the top of this page