¡ó

Character data

Data type                         Explanation

CDATA                                  ¥i¥H¥]§t¼Æ¦r,¤å¦r¸ê®Æ«¬ºAªº"¦r¦ê"
                                              ¤£¹L¥u¥i¨Ï¥Î©óÄݩʭÈ.
                                     
                                      Example:
                                      "$(value)"
                                     
name="value"      (¦b¦¹,value´N¬OÄÝ©óCDATA)

PCDATA                                Parsed CDATA. ¸òCDATA¤@¼Ë,¤£¹LPCDATAÁÙ¥i¥H¥]§t
                                               tags.

                                               Example:
                                      Text written <big> IN CAPS </big>.

NMTOKEN                            A named token,¥i¥H¥Ñ¼Æ¦r,¤å¦r©ÎªÌ²Å¸¹©Òºc¦¨
                                               (¦p".","-","_"©M";").¦ý¤£¯à¥Î©óÅܼƭȻPelement names.

                                               Example:
                                     
"text"
                                       _card1
                                       a.name.token
                                      .a-perfectly-valid.name.token 

id                                            elementªº¦W¦r,¦ý¨C¤@­Óelementªºid³£¬O°ß¤@ªº

                                               Example:
                                               <card id="card1"/>

  • Length

    %length³o­Ótype¥i¥Î¼Æ¦r¨Óªí¥Ü¿Ã¹õpixelªº­È,©ÎªÌ¨Ï¥Î¦Ê¤À¤ñªí¥Ü¬Û¹ï©ó««ª½©ÎªÌ¬O¤ô¥­ªº¤ñ¨Ò.¨Ò¦p»¡"50"¥Nªí50­Ópixel,"50%"¥Nªí¥i¨Ï¥ÎªÅ¶¡ªº¦Ê¤À¤§¤­¤Q.

    Name          Type             Usage

    %length          CDATA              [0-9] for pixels or [0-9] + % for percentage length.


    Example(1):

    For example, the values of the hspace and vspace attributes are %length.


    <img src="bitmaps/moon.wbmp" hspace="1" vspace="1"/>


    <img src="bitmaps/moon.wbmp" hspace="2%" vspace="2%"/>


  • Vdata

    %Vdata¥NªíÅܼƦW,¥u¯à¥Î©óÄÝ©Ê(attribute)

    Name          Type             Usage

    %vdata          CDATA         Attribute value possibly containing variable references.

    Example(2):

    <card id="card1" title="$(showme)">

  • Flow, inline and layout

    The %flow type represents ¡§card-level¡¨ and the %inline type ¡§text-level¡¨information.

    Name          Type             Usage

    %layout        br                    Text layout, such as line breaks.

    %inline         %text
                        %layout          Indicates areas where only pure text or variable references are handled.

    %flow          %inline           Covers card-level elements, such as text and images.
                         img
                         anchor
                         a
                         table

    Examples(3):

    %flow¸ò%inline³oÃþ¸ê®Æ«¬ºAªºÄݩʬO¥Î©óªí²{¥X¤å¥óªº¥~Æ[(format)


    <em>
            An emphasized line.
            <big>
                    A big and emphasized line.
            </big>
    </em>
    A line with no text formatting.
  • Text

    %type¥]§t¤å¦r,¥H¤Îformatting

    Name          Type             Usage


    %text            #PCDATA     Indicates text that contains formatting.
                         %emph

    Example(4):

    A line with plain text.


    <em>
            <strong>
                    A line with strong emphasis.
            </strong>
    </em>

  • Href

    %href type¥Î¨Ó«ü¦V¤@­ÓURL

    Name          Type             Usage


    %href           %vdata          URI, URL, or URN designating a hypertext node. May contain variable references.

    Example(5)


    <go href="http://wapforum.org/"/>
    <go href="file:///d:\dir\file.wml"/>
    <go href="app.wml"/>
    The values of intrinsic events are URLs:
    <card onenterforward="#card2"/>
    The src attribute of the img element is an URL:
    <img src="earth.wbmp"/>

  • Boolean

    %boolean type«üªº¬O"true"©ÎªÌ¬O"false"

    Name          Type             Usage


    %boolean     true | false      Logical value of true or false.

    Example(6):


    <card newcontext="true"/>
    <do optional="true" type="accept"/>

  • Number

    %number¥Nªí¼Æ¦r

    Name          Type             Usage

    %number     NMTOKEN     A number, from [0¡V9].

  • Emphasis

    %emph¥Î¨Óªí¹Ftextªºformatting

    Name          Type             Usage

    %emph         em |               Text formatting, for example italics or underlining.
                         strong |
                         b |
                          i |
                         u |
                         big |
                         small

    Example(8)


    <em>
            An emphasized line.
           <big>
                    A big and emphasized line.
            </big>
    </em>

  • Character entities and special characters

    Entity             Notation             Explanation


    quot                    &#34;                      quotation mark

    amp                    &#38;  #38;             ampersand

    apos                    &#39;                      apostrophe

    lt                         &#60;                       less than

    gt                        &#62;                       greater than

    nbsp                   &#160;                     non-breaking space

    shy                     &#173;                     soft hyphen (discretionary hyphen)

    Example(9):

    To include a special character, simply use the escaped notation described in the above table. For example,
     the following code includes a less than character (<) in the escaped form &#60;.


    <?xml version="1.0"?>
    <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
    "http://www.wapforum.org/DTD/wml_1.1.xml">
    <wml>
            <card id="Card_1">
                 <p>
                  Numerically 5 &#60; 10
                </p>
            </card>
    </wml>

    ¡ó WML Syntax

    WML inherits most of its syntactic constructs from XML. For detailed on the syntactical issues of XML, refer to the XML Specification.

    information
  • Entities

    WML¥i¥H¥]§t¤å¦r,¼Æ¦r¥H¤Î¤@¨Ç¦r¤¸,¦ý¬O¦³®É­Ô¦³¨Ç¦r¤¸¦bWML¤¤¬O¦³¯S§Oªº¥Î³~©ÎªÌ¬O·N¸qªº
    ¬°¤FÅý§Ú­Ì¥i¥H¦bWML¸Ìªí¹F§Ú­Ì©Ò·Q­nªºªF¦è,¦¹®É¥²»Ý¾aµÛ¤@¨Ç"²Å¸¹+¦r¤¸",³o¼Ë¤l¤~¥i¥H¹F¨ì
    §Ú­Ì·Q­nªº.

    Example(10):


    <card id="card1">
          <p>
           Ampersand = &amp; <br/>
           Quote = &quot; <br/>
           Less than = &lt; <br/>
          </p>
    </card>

    The deck generates the following user interface in the user agent:

    ¡@


  • tags

    tag¬O¤@­Ó¾ãÅ骺´y­z,¨Ò<card>¬O¤@­Ótag,<wml>¤]¬O¤@­Ótag
    ¦ýtag¥i¤£¯àÀH«K¶Ã¼Ð,¥¦¤]¦³¤@©wªº«¬¦¡

    <tag>    ³o¬Otagªº¶}©l;¦³¤@­Ótagªº¶}©l,¤]´N­n¦³¤@­Ótagªºµ²§ô

    </tag>    tagªºµ²§ô

    <tag/>    ­n¬Otag¸Ì¨S¦³¥ô¦óªºÄݩʩΪ̬O¤å¦rªº¸Ü,¨º³o´N¬O¤@­Óempty element,¨Ò¦p»¡<br/>ªí¤@­Ó´«¦æ

  • Element

    element(¼ÐÅÒ)¬Oºc¦¨WML³Ì°ò¥»ªº¤¸¯À,¨ä³Ì²³æªº¥Îªk«K¬O<tag> content </tag>©ÎªÌ¬O</tag>
    ¨ä¤¤</tag>¥Nªí¥¦¬O¤@­Óempty element,¨S¦³¤º¤å(content)

  • Attributes

    attributes(ÄÝ©Ê),¥Î¨Óªí¥ÜelementªºÃB¥~ªº¸ê°T,¨Ò¦p<tag attr="value"/>,°O±oÄݩʦW±o¤p¼g.
    ¦Ó¥BÄݩʭȰO±o¥Î(")©Î(')¥]°_¨Ó,(')¥i¥H³Q¥]§t¦b(")¸Ì­±
    ¦³¤@¨Çelement¤@©w»Ý­n¥Îattribute¨Ó°t¦X,¨Ò¦pgo³o­Óelement»Ý­nhref³o­Óattribute

    <go href="http://www.acme.com"/>

  • Comments

    ¨ä¨Ï¥Î¤èªk¸òXML¤@¼Ë,¦buser agent¼BÄý®É,·|³Q¬Ù²¤

    <!--    a comment    -->

  • Variable

    ¦bWML¸Ì,§Ú­Ì¤]¥i¥H¹³¦b¼gµ{¦¡¤@¼Ë¨úÅܼÆ,¨Ò¦p:

    $identifier

    $(identifier)

    $(identifier:conversion)

    ¨ä¤¤$¬O¥Î¨Ó¨úÅܼƭȪº

    Example(11):

    A sequence of two dollar signs ($$) represents a single dollar sign character.

    The WML code could take the following form:

            This is a $$ character.

            The value is $(amount)$$.

    In the user agent, this would be displayed as:

            This is a $ character.

            The value is 5000$.

  • Case sensitivity

    ¦bWML¸Ì,±µ¦¬eventªº³B²zª«¥ó¬O¤£¤@¼Ëªº

    Example(12):

    The following attribute values are all different:

    id="Card1"

    id="card1"

    id="CARD1"

    ¦p¤W©Ò¥Ü,ÁöµM¦P¤@­Óelement,¦ý ³¤T­Ó¤£¦Pªºattribute value,©Ò¥H·í¦ ventµo¥Í®É,
    ·|¥Ñ¬Û¹ïªºª«¥ó¨Ó³B²z,¨Ã¤£·|¤T­Ó¦P®É³£¦³°Ê§@

  • Cdata section

    Cdata°Ï(Ū°µ"c""data"),¦b³o­Ó°Ï¶ô¤ºªº¤å¦r,¦buser agent¼BÄý®É,·|³Q¤@¦r¤£°Êªº§e²{¥X¨Ó

    ¥Îªk"<![cdata[ ........................]]>"

    for example:

    <![cdata[ This is <b> a test ]]>

    ¦buser agent¤¤§Ú­Ì·|¬Ý¨ì 

    This is <b> a test