WML Tutorial 1: Comprehensively understand WML from the first actual application
The best way to learn natural language is to dissolve into the corresponding locale in communication, and learning a programming language is to look at the routine. In order to help you build the first impression of WML applications, please see the first example first:
XML Version = "1.0"?> < WML> sina WAP Next Card p> card> this is the second card. P> card> wml> Through the above example, you should learn about the following: 1. Syntax: WML syntax is similar to HTML, still a tag language, but continues XML syntax rules 2, element: In XML and WML language, the basic elements of the language are called "label" tags must be enclosed in ... p> Some special tags can have only one label, but must have end tags, for example: 3, attribute: The tag of the XML language can contain a lot of properties, providing the necessary additional information attributes to the label usually provides the necessary information to the label using attributes in the start tag, and does not by the browser display attribute value The quotation is enclosed, which can be single quotes or double quotes, and quotation marks can be nested, for example: 4. Comment Notes is convenient for producers to read the source code, and will not be displayed by the browser. WML does not support comments, for example: 5, the document structure WML document is made of Card and Deck, a decker is a collection of one or more Cards. After getting the request from the client terminal, WML sends DECK to the customer's browser from the network, and the visitor can browse all the CARD contained in the DECK without having to download each Card separately from the Internet. There are no basic content involved in other examples: 6, sensitive, whether it is labeling elements or attribute content is sensitive, inheriting the stringent characteristics of XML, any case where error can cause access errors, this is the problem that WML maker must pay attention. 7. Methods of avoiding the syntax check-CDATA CDATA will be treated as text, thereby avoiding syntax checking directly as text. Example: a Test]]> Show results for this IA a test 8. Defining Variables WML can use variables for browsers and Script to use variables on a CARD in Deck, other CARDs can be called directly. The syntax of the variable is as follows: $ IDENTIFIER $ (Identifier: Conversion) If the variable content contains space, you need to enclose with parentheses. Since the variable has the highest priority in the grammatical priority, the string containing variable declaration characters will be treated as variables, so if you want to display $, you must use two $. Example: Your Account Has $$ 15.00 in it. P> The result is: Your Account Has $ 15.00 in IT XML is a very stringent language. WML also inherits this rule, and any unregulated syntax will cause errors.