Page 49 - DCAP512_WAP_AND_WML
P. 49

Unit 4: Introduction to WML




                                                                                                Notes
               !
             Caution  One has to play off the benefits of having many cards on the WAP-enabled device at
             once against the time for a very large deck to travel from content server to mobile devices.

          Since WML is an application of XML, it has to start with a  document prolog. The prolog
          states that the particular WML belongs to which version of XML and the gives the location
          of the document type definition against which this document will be validated. The document
          type declaration tells that the root element in a WML document will be . There will be only
          one deck per document. The element defines a WML deck and there will be beginning and
          ending tags for each deck. There should be at least one card per deck. A deck also can contain
          elements and elements. The paragraph element <p> is being used to mark data in WML for
          output.

          As it is a wireless network, the data transfer size has to be very minimum. Towards this, WML
          documents from the content server have to be compiled into smaller binary file. This process of
          compilation is being accomplished by the intermediate WAP Gateway. The compiled binary
          file is called WAP binary XML (WBXML). The compilation of WML files is mostly a process of
          tokenization, in which the names of the tags and elements in the WML files are replaced by
          predefined, single-character codes. This technique drastically reduces the size of each WML
          document. When the compiled deck reaches the microbrowser, the reverse process has to be
          done by the microbrowser to bring the original document in the content server.
          White Space is a generic term for characters in a WML code that serve to break it up visually,
          but has no meaning as  far as WML is  concerned. White space represents  spaces, tabs,  line
          breaks, and so on. WML follows the XML rules as far as white space is concerned. The rule
          recommends to ignore it before and after an element and to compress all other sequences of
          white spaces into a single space between two words. This process reduces the total number
          bytes  of a WML  application. Thus  compilation process  actually means applying this  rule
          about white space as it proceeds. The other important feature is that WML supports inserting
          comments in the code. They start with the sequence. The comments will not be displayed in
          the  microbrowsers.



             Did u know?  What is HDML?
             WML (Wireless Markup Language), formerly called HDML (Handheld Devices Markup
             Languages), is a language that allows the text portions of Web pages to be presented on
             cellular telephones and personal digital assistants (PDAs) via wireless access.

          There are two more possibilities to extend a WML file. They are adding more elements to the
          existing deck or adding attributes to the elements that already exist. In WML, there are three
          attributes that can be used with almost all elements: xml:lang, class and id. The  first one  is
          xml:lang and this attribute is optional. Its value defines the human language of any data that
          may be presented to the user, so that user agent can modify its behavior if there is a need for the
          displaying purpose.
          By specifying a class attribute with the same value in several different elements, these elements
          can be made part of the same class. This feature does not make any impact on the microbrowser
          or to the users of that WML application. But this feature can be used by some external program
          that was asked to process the decks present in the WML application.
          The id attribute is used to provide an element with a unique name within a single deck. The id
          attribute specifies a name for a card. This feature is necessary if there is more than one card in the





                                           LOVELY PROFESSIONAL UNIVERSITY                                   43
   44   45   46   47   48   49   50   51   52   53   54