3

xiaoxiao2021-03-06  148

[转 _ 编] 1. Wml character set and the character set encoding WML using XML, that is, universal character set ISO / IEC-1062., The unified character encoding standard Unicode 2.0. At the same time, WML also supports other series of characters, such as UTF-8, ISO-8859-1 or UCS-2, etc. Where: UTF-8 refers to the transformation format 8 of the general character set UCS (Universal Character Set), mainly transmitting the conversion coding of international character sets. UTF-8 uses 8-bit encoding of UCS characters, providing a secure coding format to effectively avoid eavesdropping, interception, and illegal decryption during data transfer. At the same time, UTF-8 is fully compatible with the 7-bit ACSII code and does not affect such encoding implementation; its encoding rules are very strict, which can effectively avoid synchronous transmission errors, and other character sets will provide enough space. The ISO-8859-1 character set is an extension of the ACSII character set developed by the International Standardization Organization to represent all Western European languages. Like ISO LATIN-1, ISO-8859-1 is extremely similar to the character set of American National Standards Institutes in the US National Standard Association in the Windows environment. Most cases do not need to be distinguished. The HTTP protocol uses the ISOLATIN-1 character set when not specified. Therefore, for the WML page represents non-ACSII (Non-ACSII) characters, developers need to use the corresponding ISO LATIN-1 encoded characters. UCS-2 is ISO 1062. Customized Universal Multiple-Octer Coded Character Set 2 bytes (i.e., 16-bit) coding standard, character encoding value with Unicode characters standard encoding The value is equal. The WML document can be used to use any character encoding standard defined by the HTML 2.0 specification. Generally speaking, the character encoding of the WML document is to convert to additional encoding formats to fit the character standards used by the WAP user, otherwise, the mobile browser cannot display characters in the WML page. However, some character information may be lost when encoded conversion, so if the encoding conversion of the WML document is performed on the client, it may cause certain result information to be lost without being broodowed by the user. Therefore, if necessary, we should try to complete the encoded conversion before the WML page is transferred to the user browser. In order to solve this problem, on the one hand, we need to add data types that define the WML for the web server to allow the server to deliver this data, on the other hand, we need to develop the principles of encoding conversion. 2 WML characters Use basic rules WML is a more stringent language, and characters must comply with the corresponding rules. These basic rules mainly include the following aspects: 1) Sensitive. In WML, whether label elements or attribute content is sensitive, this inherits the stringent characteristics of XML, and any case error can cause access errors. In general, all labels, properties, regulations, and enumerations of WML and their acceptable values ​​must be lowercase, the name and variables of the Card can be capitalized and lowercase, but it is case sensitive. The names and parameters of the parameters are case sensitive, such as variable1, variable1, and variable1 are different parameters.

2) Space. For continuous empty characters, only one space is required when running. The property name, the symbol (=) and the value cannot have spaces. 3) Tags. The value of the label is enclosed in double quotes (") or single quotes ('). For labels that are not pair, you must add a compliance (/) before greater than the number (>), such as the wrap tag must be written Correctly .4) Not displayed. In WML, the characters that are not displayed mainly include newline characters, carriage returns, spaces and horizontal tabs, and their 8-bit sixteen internal code is 10, 13, 32, and 9. When executed, WML will ignore more than one or more non-display characters, that is, WML will convert one or more consecutive wraps, enter, horizontal tabs and spaces into one. Empty .5) Reserved characters. This is some special characters of WML, such as less than numbers (<), greater than numbers (>), single quotes "'", double quotes "" ", and number (&). 6) Display Chinese characters. If you want the WML program to be executed, you can display the Chinese characters, you only need the program to start using eNCoding to specify the Chinese character set. For example: . Note: The form and method of specifying the Chinese character set may vary depending on the development tool or WAP phone. 3 Variables WML programming can use variables, and the variable must be defined before use. Once the variable is defined on a CARD in a CARD in the DECK, the variable can be called directly without the redefine. Defining the syntax format of the variable is: $ IDENTIFIER $ (Identifier: Conversion) where Identifier refers to the variable name, or a variable mark; Conversion refers to the alternative to variables. The variable name is made of US-ACSII code, underscore and numbers and can only begin with a US-ACSII code. The variable name is strictly sized, that is, the variable name is sensitive. The syntax for defining variables has the highest interpretation priority in WML. The use of the variable is as follows: 1) In WML, the variable can be used in a string and can update the value of the variable in the run. 2) When the variable is equivalent to the empty string, the variable will be in an unstormed state, that is, empty (NULL). 3) When the variable is not equal to the empty string, the variable will be in the setting state, which is the NOT NULL state. 4) Under the "$ Identifier" form, WML usually indicates the end of the variable name with a space behind the variable name. If spaces in some cases cannot represent an end of a variable name, or there is a space in the variable name, you must enclose the variable in the form of "Identifier" using parentheses. The variable in the WML program can be replaced, we can assign the value of the variable to a text in the CARD. The relevant variable replacement is described below: 1) In the WML program, only the text portion can be replaced. 2) Alternatives are generally at runtime, and alternative does not affect the current value of the variable. 3) Any label is implemented in a manner in accordance with a string. 4) Alternative is implemented in a manner in accordance with a string. Since the variable has the best priority in the grammatical priority, the string containing the variable declaration character will be treated as a variable, so if you want to display the "$" symbol, you need to use two "$" to explain continuously.

For example:

Your Acconut HAS $$ 15.00 in IT The result is: Your Account HAS $ 15.00 in IT. 4. WML core data type WML core data type belongs to characteristic data, which is defined according to the data type of XML, and has a total of 2. What is done? 1) CDATA type. This type of data is one of the most WML, which can be a number, string, or a string containing a number. However, when defined, whether the number or string must be defined in the form of text, and the data quotation marks are used. The CDATA type data is only used for attribute values. For example, "value" or name = "value", etc. Note that the value refers to the data value of the CDATA type. 2) PCDATA type. This is a type of data decomposed from the CDATA, in addition to the number of text forms, strings, or two mixed strings, can also be a label of WML. PCDATA type data can only be used for Element of WML. 3) NMTOKEN. This is a special amount of data that contains or partially contains data that contains numbers, letters and punctuation, which belong to NMToken type data. This data can begin with punctuation, but not to define variable names or elements. 4) ID type. Data types specifically used to define the name of the WML element. The DATA type is more flexible, which can make variables or data from grammar checks. This is because the data content in the CDATA will be handled as text, so that WML's syntax check can be avoided, directly as text. 2.3.5 WML Data Value Properties In addition to NMTOKEN type data, WML other three data must be defined in the form of text form. What we care is that these types of data can indicate which data values? Or what is the nature of the data value they represent? In fact, WML data can only be in the nature (LENGTH), macro variable (VDATA), stream (Flow), Layout, Text, HREF, Boolean (Boolean), data (NUMBER) or enhancement (EMPHASIS). 5 cards with the card group When we analyzed the structure of the WML program, the information of the WML document was tested through the form of card sets and card sets. A DECK is a collection of one or more Cards. When the client terminal issues a request, WML is sent from the network to the customer's browser, and DECK is the minimum unit of the server sends information. Once the user browser receives DECK, you can browse all of the CARDs included. CARD is used to represent or describe one or more user interactions. 6 Card Group Templates The same card set usually contains many cards, and these cards are defined, attributes or formats are usually similar. If we define each card one by one, it is obviously very troublesome. To this end, WML provides the function of the card set template, and a series of standards and parameters are defined in the template, which can be applied to all cards of the same card group to greatly improve our programming efficiency. We will introduce it to the content of the card group template.

7 WML and URL, program block anchors We know that the Global Network WWW is a network of various information and equipment, in order to ensure three specification, one, unified resource locator URL provides all networks Resource standard nomenclature and positioning method; Second, standard protocols, such as HTTP protocols, providing WWW resources transmission mode; Standard content types, such as HTML, WML, provide content forms and standards for WWW resources. WML uses these specifications and expands the range of URLs. In WML, not only super connection, file path, and file name can be used as URL processing, card name, macro variable name and various internal resource names, etc. can also be treated as a URL. To this end, WML improves the HTML named resource location, using the Fragment Anchor to process the status of a certain program in the WML program. The block anchor is defined according to the document WML rule and written in a way before the segment represents the word before the segment represents. With block anchors, WML programs can locate different cards in the same card group. If the block is not specified in the program, the URL name referenced in the program refers to the entire card group, and the name of the card group is also the name of the first card in this card group. 8 Browser Operation History In order to perform the execution of the WML program in the browser side, WML uses the "Browser Front Relationship" function to save the status of the WML program and various parameters, variables, etc., which can be used to record the user's operation. At the same time, WML also provides a simple navigation history model that records the various operations when users' browsing in the form of a URL address, and puts these URL addresses into the historical push. By pushing, users can achieve historical browsing and other operations.

转载请注明原文地址:https://www.9cbs.com/read-127929.html

New Post(0)