WAP Homepage
WAP homepage tidak begitu berbeda dari HTML homepage. Bahasa markup yang digunakan untuk WAP adalah WML (Wireless Markup Language). WML menggunakan tag - seperti HTML - tetapi sintaks yang lebih ketat dan sesuai dengan standar
WML page memiliki ekstensi *. wml, sama seperti halaman HTML memiliki ekstensi *. html. WML Tag
WML terutama tentang teks. Tag yang akan memperlambat komunikasi dengan perangkat genggam bukan bagian dari standar WML. Penggunaan tabel dan gambar sangat terbatas.
Sejak WML merupakan aplikasi XML, semua tag bersifat case sensitive (<wml> tidak sama dengan <wml>), dan semua tag harus benar tertutup. WML Decks dan Kartu
Example WML document:
<?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="HTML" title="HTML Tutorial">
<p>Our HTML Tutorial is an award winning
tutorial from W3Schools.</p>
</card>
<card id="XML" title="XML Tutorial">
<p>Our XML Tutorial is an award winning
tutorial from W3Schools.</p>
</card>
</wml>
Seperti yang dapat anda lihat dari contoh, dokumen WML adalah dokumen XML. Yang DOCTYPE didefinisikan sebagai wml, dan DTD diakses pada www.wapforum.org/DTD/wml_1.1.xml.
Isi dokumen di dalam <wml> ...</ wml> tags. Masing-masing kartu dalam dokumen yang ada di dalam kartu ...</ <card>> tag, dan sebenarnya ada di dalam <p> paragraf ...</ p> tag. Kartu masing-masing elemen memiliki id dan judul.
WML Reference
The links in the "Start tag" column points to more useful information about the specific tag. It also cover attributes of the specific tag and code examples!Deck / Card Elements
Start tag | Purpose | WML |
---|---|---|
<access> | Defines information about the access control of a deck | 1.1 |
<card> | Defines a card in a deck | 1.1 |
<head> | Contains information about the document | 1.1 |
<meta> | Defines meta information about the document | 1.1 |
<template> | Defines a code template for all the cards in a deck | 1.1 |
<wml> | Defines a WML deck (WML root) | 1.1 |
<!--> | Defines a comment | 1.1 |
Text Elements
Start tag | Purpose | WML |
---|---|---|
<br> | Defines a line break | 1.1 |
<p> | Defines a paragraph | 1.1 |
<table> | Defines a table | 1.1 |
<td> | Defines a table cell (table data) | 1.1 |
<tr> | Defines a table row | 1.1 |
Text Formatting Tags
Start tag | Purpose | WML |
---|---|---|
<b> | Defines bold text | 1.1 |
<big> | Defines big text | 1.1 |
<em> | Defines emphasized text | 1.1 |
<i> | Defines italic text | 1.1 |
<small> | Defines small text | 1.1 |
<strong> | Defines strong text | 1.1 |
<u> | Defines underlined text | 1.1 |
Anchor Elements
Start tag | Purpose | WML |
---|---|---|
<a> | Defines an anchor (a link) | 1.1 |
<anchor> | Defines an anchor (a link) | 1.1 |
Image Elements
Start tag | Purpose | WML |
---|---|---|
<img> | Defines an image | 1.1 |
Event Elements
Start tag | Purpose | WML |
---|---|---|
<do> | Activates a task when the user clicks on a word/phrase on the screen | 1.1 |
<onevent> | Contains code to be executed when one of the following events occurs: onenterbackward, onenterforward, onpick, ontimer | 1.1 |
<postfield> | Contains information to be sent to the server along with a <go> tag | 1.1 |
Task Elements
Start tag | Purpose | WML |
---|---|---|
<go> | Represents the action of switching to a new card | 1.1 |
<noop> | Says that nothing should be done (noop stands for "no operation"). Used to override deck-level elements | 1.1 |
<prev> | Represents the action of going back to the previous card | 1.1 |
<refresh> | Refreshes some specified card variables. If any of the variables are shown on the screen, this task also refreshes the screen | 1.1 |
Input Elements
Start tag | Purpose | WML |
---|---|---|
<fieldset> | Used to group together related elements in a card | 1.1 |
<input> | Defines an input field (a text field where the user can enter some text) | 1.1 |
<optgroup> | Defines an option group in a selectable list | 1.1 |
<option> | Defines an option in a selectable list | 1.1 |
<select> | Defines a selectable list | 1.1 |
Variable Elements
Start tag | Purpose | WML |
---|---|---|
<setvar> | Sets a variable to a specified value in a <go>, <prev>, or <refresh> task | 1.1 |
<timer> | Defines a card timer | 1.1 |
Character Entities
Result | Description | Entity Name | Entity Number |
---|---|---|---|
& | ampersand | & | & |
' | apostrophe | ' | ' |
> | greater-than | > | > |
< | less-than | < | < |
non-breaking space | |   | |
" | quotation mark | " | " |
| soft hyphen | ­ | ­ |
The Complete WML DTD:
<!--Wireless Markup Language (WML) Document Type Definition.
Copyright Wireless Application Protocol
Forum Ltd., 1998,1999.
All rights reserved.
WML is an XML language. Typical usage:
<?
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
...
</wml>
Terms and conditions of use are
available from the Wireless
Application Protocol Forum Ltd. web site at
http://www.wapforum.org/docs/copyright.htm.
-->
<!ENTITY % length "CDATA">
<!-- [0-9]+ for pixels or [0-9]+"%"
for percentage length -->
<!ENTITY % vdata "CDATA">
<!-- attribute value possibly containing
variable references -->
<!ENTITY % HREF "%vdata;">
<!-- URI, URL or URN designating a
hypertext node. May contain variable references -->
<!ENTITY % boolean "(true|false)">
<!ENTITY % number "NMTOKEN">
<!-- a number, with format [0-9]+ -->
<!ENTITY % coreattrs "id ID #IMPLIED
class CDATA #IMPLIED">
<!ENTITY % emph
"em | strong | b | i | u | big | small">
<!ENTITY % layout "br">
<!ENTITY % text "#PCDATA | %emph;">
<!-- flow covers "card-level" elements,
such as text and images -->
<!ENTITY % flow
"%text; | %layout; | img | anchor | a | table">
<!-- Task types -->
<!ENTITY % task "go | prev | noop | refresh">
<!-- Navigation and event elements -->
<!ENTITY % navelmts "do | onevent">
<!--============= Decks and Cards =============-->
<!ELEMENT wml ( head?, template?, card+ )>
<!ATTLIST wml
xml:lang NMTOKEN #IMPLIED
%coreattrs;
>
<!-- card intrinsic events -->
<!ENTITY % cardev
"onenterforward %HREF; #IMPLIED
onenterbackward %HREF; #IMPLIED
ontimer %HREF; #IMPLIED"
>
<!-- card field types -->
<!ENTITY % fields
"%flow; | input | select | fieldset">
<!ELEMENT card (onevent*, timer?, (do | p)*)>
<!ATTLIST card
title %vdata; #IMPLIED
newcontext %boolean; "false"
ordered %boolean; "true"
xml:lang NMTOKEN #IMPLIED
%cardev;
%coreattrs;
>
<!--============= Event Bindings =============-->
<!ELEMENT do (%task;)>
<!ATTLIST do
type CDATA #REQUIRED
label %vdata; #IMPLIED
name NMTOKEN #IMPLIED
optional %boolean; "false"
xml:lang NMTOKEN #IMPLIED
%coreattrs;
>
<!ELEMENT onevent (%task;)>
<!ATTLIST onevent
type CDATA #REQUIRED
%coreattrs;
>
<!--======== Deck-level declarations ========-->
<!ELEMENT head ( access | meta )+>
<!ATTLIST head
%coreattrs;
>
<!ELEMENT template (%navelmts;)*>
<!ATTLIST template
%cardev;
%coreattrs;
>
<!ELEMENT access EMPTY>
<!ATTLIST access
domain CDATA #IMPLIED
path CDATA #IMPLIED
%coreattrs;
>
<!ELEMENT meta EMPTY>
<!ATTLIST meta
http-equiv CDATA #IMPLIED
name CDATA #IMPLIED
forua %boolean; #IMPLIED
content CDATA #REQUIRED
scheme CDATA #IMPLIED
%coreattrs;
>
<!--================ Tasks ================-->
<!ELEMENT go (postfield | setvar)*>
<!ATTLIST go
href %HREF; #REQUIRED
sendreferer %boolean; "false"
method (post|get) "get"
accept-charset CDATA #IMPLIED
%coreattrs;
>
<!ELEMENT prev (setvar)*>
<!ATTLIST prev
%coreattrs;
>
<!ELEMENT refresh (setvar)*>
<!ATTLIST refresh
%coreattrs;
>
<!ELEMENT noop EMPTY>
<!ATTLIST noop
%coreattrs;
>
<!--============= postfield =============-->
<!ELEMENT postfield EMPTY>
<!ATTLIST postfield
name %vdata; #REQUIRED
value %vdata; #REQUIRED
%coreattrs;
>
<!--============= variables =============-->
<!ELEMENT setvar EMPTY>
<!ATTLIST setvar
name %vdata; #REQUIRED
value %vdata; #REQUIRED
%coreattrs;
>
<!--============= Card Fields =============-->
<!ELEMENT select (optgroup|option)+>
<!ATTLIST select
title %vdata; #IMPLIED
name NMTOKEN #IMPLIED
value %vdata; #IMPLIED
iname NMTOKEN #IMPLIED
ivalue %vdata; #IMPLIED
multiple %boolean; "false"
tabindex %number; #IMPLIED
xml:lang NMTOKEN #IMPLIED
%coreattrs;
>
<!ELEMENT optgroup (optgroup|option)+ >
<!ATTLIST optgroup
title %vdata; #IMPLIED
xml:lang NMTOKEN #IMPLIED
%coreattrs;
>
<!ELEMENT option (#PCDATA | onevent)*>
<!ATTLIST option
value %vdata; #IMPLIED
title %vdata; #IMPLIED
onpick %HREF; #IMPLIED
xml:lang NMTOKEN #IMPLIED
%coreattrs;
>
<!ELEMENT input EMPTY>
<!ATTLIST input
name NMTOKEN #REQUIRED
type (text|password) "text"
value %vdata; #IMPLIED
format CDATA #IMPLIED
emptyok %boolean; "false"
size %number; #IMPLIED
maxlength %number; #IMPLIED
tabindex %number; #IMPLIED
title %vdata; #IMPLIED
xml:lang NMTOKEN #IMPLIED
%coreattrs;
>
<!ELEMENT fieldset (%fields; | do)* >
<!ATTLIST fieldset
title %vdata; #IMPLIED
xml:lang NMTOKEN #IMPLIED
%coreattrs;
>
<!ELEMENT timer EMPTY>
<!ATTLIST timer
name NMTOKEN #IMPLIED
value %vdata; #REQUIRED
%coreattrs;
>
<!--============= Images =============-->
<!ENTITY % IAlign "(top|middle|bottom)" >
<!ELEMENT img EMPTY>
<!ATTLIST img
alt %vdata; #REQUIRED
src %HREF; #REQUIRED
localsrc %vdata; #IMPLIED
vspace %length; "0"
hspace %length; "0"
align %IAlign; "bottom"
height %length; #IMPLIED
width %length; #IMPLIED
xml:lang NMTOKEN #IMPLIED
%coreattrs;
>
<!--============= Anchor =============-->
<!ELEMENT anchor
( #PCDATA | br | img | go | prev | refresh )*>
<!ATTLIST anchor
title %vdata; #IMPLIED
xml:lang NMTOKEN #IMPLIED
%coreattrs;
>
<!ELEMENT a ( #PCDATA | br | img )*>
<!ATTLIST a
href %HREF; #REQUIRED
title %vdata; #IMPLIED
xml:lang NMTOKEN #IMPLIED
%coreattrs;
>
<!--============= Tables =============-->
<!ELEMENT table (tr)+>
<!ATTLIST table
title %vdata; #IMPLIED
align CDATA #IMPLIED
columns %number; #REQUIRED
xml:lang NMTOKEN #IMPLIED
%coreattrs;
>
<!ELEMENT tr (td)+>
<!ATTLIST tr
%coreattrs;
>
<!ELEMENT td
( %text; | %layout; | img | anchor | a )*>
<!ATTLIST td
xml:lang NMTOKEN #IMPLIED
%coreattrs;
>
<!--== Text layout and line breaks ==-->
<!ELEMENT em (%flow;)*>
<!ATTLIST em
xml:lang NMTOKEN #IMPLIED
%coreattrs;
>
<!ELEMENT strong (%flow;)*>
<!ATTLIST strong
xml:lang NMTOKEN #IMPLIED
%coreattrs;
>
<!ELEMENT b (%flow;)*>
<!ATTLIST b
xml:lang NMTOKEN #IMPLIED
%coreattrs;
>
<!ELEMENT i (%flow;)*>
<!ATTLIST i
xml:lang NMTOKEN #IMPLIED
%coreattrs;
>
<!ELEMENT u (%flow;)*>
<!ATTLIST u
xml:lang NMTOKEN #IMPLIED
%coreattrs;
>
<!ELEMENT big (%flow;)*>
<!ATTLIST big
xml:lang NMTOKEN #IMPLIED
%coreattrs;
>
<!ELEMENT small (%flow;)*>
<!ATTLIST small
xml:lang NMTOKEN #IMPLIED
%coreattrs;
>
<!ENTITY % TAlign "(left|right|center)">
<!ENTITY % WrapMode "(wrap|nowrap)" >
<!ELEMENT p (%fields; | do)*>
<!ATTLIST p
align %TAlign; "left"
mode %WrapMode; #IMPLIED
xml:lang NMTOKEN #IMPLIED
%coreattrs;
>
<!ELEMENT br EMPTY>
<!ATTLIST br
xml:lang NMTOKEN #IMPLIED
%coreattrs;
>
<!ENTITY quot """>
<!-- quotation mark -->
<!ENTITY amp "&#38;">
<!-- ampersand -->
<!ENTITY apos "'">
<!-- apostrophe -->
<!ENTITY lt "&#60;">
<!-- less than -->
<!ENTITY gt ">">
<!-- greater than -->
<!ENTITY nbsp " ">
<!-- non-breaking space -->
<!ENTITY shy "­">
<!-- soft hyphen (discretionary hyphen) -->
<!--
Copyright Wireless Application Protocol
Forum Ltd., 1998,1999.
All rights reserved.
-->
Bagi yang pengen mencoba WAP Proof 2008 bisa donlot disini:
Link: Download
0 komentar:
Posting Komentar