All WML documents must have the DOCTYPE declaration. It should be placed between the XML declaration and the <wml> element. Below is the DOCTYPE declaration for WML 1.3. You can simply copy and paste it into your WML files.
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN" "http://www.wapforum.org/DTD/wml13.dtd">
The DOCTYPE declaration specifies the name of the DTD (Document Type Definition) and the URL to the DTD. The DTD contains information about the syntax of the markup language. It defines what elements and attributes can be used in the markup and the rules that they should be used. For example, the DTD of WML specifies that the <card> element should be enclosed in the <wml></wml> tag pair. If you do not follow this rule, your WML document is said to be invalid. WAP browsers will complain if you try to view an invalid WML document.
If you are interested in the DTD of WML 1.3, it can be downloaded at http://www.wapforum.org/DTD/wml13.dtd.
If you want your WML code to conform to an earlier version of the WAP standard, you have to change the DTD.
This is the DTD declaration for WML 1.2:
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN" "http://www.wapforum.org/DTD/wml12.dtd">
This is the DTD declaration for WML 1.1:
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
Validation tools can be used to check whether your WML document conforms to the WML language rules by comparing your WML document with the DTD specified in the DOCTYPE declaration. Such validation tools are integrated in some IDEs.
|Previous Page||Page 4 of 50||Next Page|
- 1. WML (Wireless Markup Language) Introduction
- 2. WML Deck and Card
- 3. WML Document Structure
- 4. WML Generic Metadata: <meta>
- 5. Comments in WML
- 6. Line Breaking in WML
- 7. Font Size and Style in WML
- 8. WML Preformatted Text: <pre>
- 9. WML Images
- 10. WML Tables
- 11. WML Anchor Links
- 12. Programming Softkeys of Mobile Phones and the <do> Element
- 13. WML Template and Menu
- 14. WML Events and the <onevent> Tag
- 15. Timer and the ontimer Event
- 16. WML Event: onenterbackward
- 17. WML Event: onenterforward
- 18. WML Selection Lists and the onpick Event
- 19. WML Input Fields
- 20. WML Variables
- 21. Submitting Form Data to the Server in WML
- 22. Clearing a Saved Form in WML