WML (Wireless Markup Language)

Teksta marķēšana

Birkas "p" un "br"

<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">

<wml> 
<card>  
<p>Pirmaa rindkopa</p> 
<p>Otraa rindkopa</p> 
<p>Shii ir <br/>the <br/>treshaa <br/>rindkopa</p> 
</card> 
</wml>

un birkas "b", "i", "em", "u", "strong", "big" un "small" izmanto līdzīgi kā HTML. "$" WML ir speciāls simbols, ar kuru sākas mainīgo vārdi. Tāpēc, lai ierakstītu WML dokumentā simbolu "$", jālieto "$$"

<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">

<wml> 
<card>  
<p>normal <em>em</em> <strong>strong</strong></p> 
<p>normal <b>bbb</b> <i>iii</i>  <u>uuu</u></p> 
<p>normal <big>big $$</big> <small>small</small></p> 
</card> 
</wml>

Hipersaites

Hipersaites veido tāpat kā HTML. Ar to palīdzību var "lēkāt" starp ekrāna "kartēm", kā arī atvērt citu aplikāciju.

<?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='aaa'>  
<p>This is card <strong>aaa</strong></p> 
<p>Go to <a href='#bbb'>bbb</a></p> 
<p>Go to <a href='#ccc'>ccc</a></p> 
<p>Go to <a href='../Example3/index'>previous example</a></p> 
</card> 

<card id='bbb'>  
<p>This is card <strong>bbb</strong></p> 
<p>Go to <a href='#aaa'>aaa</a></p> 
<p>Go to <a href='#ccc'>ccc</a></p> 
</card> 

<card id='ccc'>  
<p>This is card <strong>ccc</strong></p> 
<p>Go to <a href='#aaa'>aaa</a></p> 
<p>Go to <a href='#bbb'>bbb</a></p> 
</card> 
</wml>

Birka "do" piesaista darbību kādam no telefona "aktīvajiem" taustiņiem, t.i. tiem, kuru nozīme var mainīties atkarībā no konteksta (soft buttons). Birka "go" darbojas kā hipersaite.

<?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='c1'>  
<do type="accept"> 
     <go href='#c2'/> 
</do> 
<p>Card 1</p> 
</card> 

<card id='c2'>  
<p>Card 2</p> 
<do type="accept"> 
     <go href='#c3'/> 
</do> 
</card> 

<card id='c3'>  
<do type="accept"> 
     <go href='#c1'/> 
</do> 
<p>Card 3</p> 
</card> 
</wml>

Birka "prev" atgriež telefonu pie iepriekšējā "card" elementa.

<?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='c1'>  
<do type="accept"><go href='#c2'/></do> 
<p><strong>Card 1</strong></p> 
<p>Go to <a href="#c2">card 2</a></p> 
<p>Go to <a href="#c3">card 3</a></p> 
</card> 

<card id='c2'>  
<p><strong>Card 2</strong></p> 
<do type="accept"><go href='#c3'/></do> 
<do type="prev"><prev/></do> 
</card> 

<card id='c3'>  
<do type="prev"><prev/></do> 
<p><strong>Card 3</strong></p> 
</card> 
</wml>

Brika "template" piekārto vairākiem "card" elementiem identisku iespēju (hipersaiti). Birka "noop" norāda, ka konkrētajā "card" elementā "templatē" definēta hipersaite nav redzama.

<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">

<wml> 
<template> 
<do type='help'><go href='#help'/></do> 
</template> 

<card id='c1'>  
<do type="accept"><go href='#c2'/></do> 
<p><em>Card 1</em></p> 
<p>Click <strong>OK</strong> button to go to the next card</p> 
</card> 

<card id='c2'>  
<p><em>Card 2</em></p> 
<p>Click <strong>OK</strong> button to go to the next card</p> 
<do type="accept"><go href='#c3'/></do> 
<do type="prev"><prev/></do> 
</card> 

<card id='c3'>  
<do type="prev"><prev/></do> 
<p><em>Card 3</em></p> 
</card> 

<card id='help'>  
<do type="prev"><prev/></do> 
<do type="help"><noop/></do> 
<p>This is the help file.</p> 
</card> 
</wml>

Lapa mainīta 2004-11-19 20:34:12