I list below all topic groups, which I have done according to subjects, which they handle. You can return to this topic group by using this menu and the link Table of topic groups on the top of the each page.
| |||||||||||||||||||
![]() | Table of topic groups > Front page of help pages > Help pages > 3. Help for TM WML menu |
|---|
I have read a book Inside WAP (a Finnish book), Pekka Niskanen, a worker of Acta Systems Oy (IT Press, 2000).
The book handle WML 1.1, WMLScript 1.1, basic Perl encoding, some Java-servlets and WAP Servers. Pekka Niskanen lists all elements and attributes. The attribute and element list in pages 413-415 has some errors. It is not done exactly according to the WML 1.1 DTD and it is partial invalid. The book is however an excellent book for Finnish web designers to learn how to create WML-documents.
Acta Systems Oy, IT Press, Wap Forum (WML 1.1).This help page handles primary WML 1.2 and the TM WML plugins menu is based on the wml12.dtd. Also used terms are primary from the official DTD-file. The menu includes all WML 1.2 elements and attributes. I have made new source codes including also WML 2.0 tags. In the new source codes I have marked WML 1.2+which elements or attributes are only in the WML 1.2 or newer specifications (in the previous versions I marked them just WML 1.2). When I have put WML 1.2, they concern automatic also WML 1.1 but not WML 2.0.
In WML 1.2 core attributes
id and class can be used to every
element. WML 2.0 has also style and title as core attributes. The attribute style is not at all used in WML 1.2. The attribute title is used in WML 1.2 only with some elements. Because it is not in WML 1.2 a core attribute, I list it as a possible implied attribute, but I don't list other core attributes as possible implied attributes. All core attributes including the attribute title have a separate button. In all cases I have added all
required attributes as default attributes - you can't miss them!
The TM WML menu doesn't include elements, which are used in
the Push technique and Push Proxy
Gateway. Pekka Niskanen doesn't handle this matter
thoroughly. He gives one example, where is used two other
XML-based languages, which use as root elements pap
(it comes from words Push Access Protocol) and
rdf:RDF. They have TM WAPPush menu an
it has its own help page
. Also the TM WMLScript menu has a separate help page
.
Because WML and Push languages are based on
XML, the encoding should fulfil XML
requirements. All tags must have the termination, either
the termination tag or / at the end of the empty
elements (for example <br />). Tag names are
case-sensitive. In WML all element names and attributes must be
in lower case letters, but values can have also upper case
characters. In XML-documents all attributes should be quoted.
WML resembles HTML - in fact it is like a special
XHTML for WAP devices. The basic metaphor in WML is a
pack of cards. The whole documents is the pack
and individual cards are like sub-pages (in the official DTD-file
the whole document is called as a deck). In fact in
this matter it is close the first DTD for HTML by
Dan Connolly from 1992, where the document was
divided into pieces with SECTION elements.
The title attribute of the card is like the
TITLE element in HTML. The whole deck
(wml) can have certain common attributes to all
card elements by using the template
element.
The deck can have an optional head-element like
HTML (in the HTML HEAD is a required element), which
can have meta or access elements. The
only required attribute to the element meta is
content, but because it needs always another
attributes, I don't list it alone.
WML use as basic block-level elements p and
pre (WML 1.2). WML has most used text layout
elements (for example b). Note, that b
and other text layout elements are are marked in the DTD as
%Flow (in HTML they are defined as
inline). %Flow in wml12.dtd means not the same as in
HTML-documents because according to wml12.dtd text layout
elements can be surround tables. The table element
is not a pure block-level element even if some user agents create
line breaks before or after tables. I recommend however to use
text layout elements like inline-level elements in HTML and use
on p as the parent-element of
table.
WML doesn't have list elements. Simple list presentations can create with tables. Form elements don't work exactly at the same way as in HTML (I handle them later in this help file).
WML user agents support images, which should be in special format (WBMP = Wireless BitM ap Picture) even if some WML user agents also support GIF and JPG images. It is also possible to use built-in icons or icon, which are down loaded permanent into the device. Pekka Niskanen lists 175 icons.
Hyper links work in some matters at the same way as in HTML-documents (look at the button A(nchors)). Because the document is divided into sub-documents, WML has special linking elements and attributes, which are classified in buttons Timer, Events, Go and Tasks.
Event elements work a little bit same way as event handlers in JavaScript. In addition WML has WMLScript, but not all WML capable mobile phones support it. That's why it is not very reasonable to use it today. Most applications can do without it. In principle to be WAP-compliant, WMLScript must be supported.
WMLScript is however quite easy. WML and WML script are
tightly integrated to each others, because the are designed to
work together (WMLScript is not an additional extension to WML
like JavaScript to HTML). Predefined functions use much the same
kind of names as WML attributes and elements, which make the same
task. Look at following pair, which can be used in order to
control browsing: <prev /> -
WMLBrowser.prev(), newcontent (attribute)
- WMLBrowser.newContent().
Instead or ordinary WML documents or individual cards, links and forms can call CGI-applications or WMLScripts. Scripts are referred like HTML-documents by using relative or absolute paths. The function call must have also the name of the function (as if it is an anchor) and an optional parameter list like href="/myscript.wmls#myfunction('mystring1','mystring2')".
This system is also used inside WMLScripts, if a function is called from another WMLScript (it is possible to call all functions, which have the keyword extern). It is possible to shorten the function name inside functions by using keywords use url like in this example:
// the shortening code
use url myScript http://www.some_server/~some_user/WMLScripts/myscript.wmls
// later on the script after shortening
function someFunction() {
var a = myScript#myfunction();
}
It is possible to restrict to use certain addresses. This can
be done either by using in WML the access element
(used inside the element head) or in WMLScript
keywords use access. I both cases must define either
domain, path or both of them. Both WML
and WMLScript can transmit meta information.
Pekka Niskanen writes, that WMLScript base on JavaScript and
ECMAScript. In my mind it also borrow some features
from Java or Perl, because it can use libraries. When Pekka
Niskanen wrote his book, WML Script had following standard
libraries: Lang, Float,
String, URL, WMLBrowser
and Dialog, which must be available when calling
functions. Also some other libraries are available like
Debug, which is useful in testing scripts. Like Java
it needs a virtual machine in the browser. Unlike JavaScript the
script is always in external text files, which
use the *.wmls extension like
myscript.wmls.
I list all keywords and functions of standard libraries in an additional module. I explain in the help file shortly WMLScript functions. I would be pleased, if someone could help me to create proper explanations. Please, send me your proposals to me with an e-mail (add to beginning of the e-mailaddress my name, Tapio Markula, separated with a comma).
It is possible to create simple forms (special form elements
are in the button Fields - in the DTD is written
about Card Fields). WML doesn't have a gathering
form element like HTML, which has the element FORM,
because in WML in most cases forms use do and
go elements. The element go can use
also by simple linking instead of anchor elements (a
or anchor). The element do with the
attribute label creates in both cases a button or an
activation text (usually with borders). Do resemble
the BUTTON HTML-element. If the do
element is used other form elements (card fields) are inside
p or pre tags. Compared to HTML the
actual form is then divided into two pieces and the
card element itself works like the FORM
element in HTML.
It is possible to organize form elements with
fieldset and optiongroup elements. Some
WML browsers doesn't support the fieldset element,
but you can get clearer code, if you use it.
In WML can use variables, which are common to WMLScripts.
WMLScript can read and write WML variables. WML can transform
variables in order to the handle them in WMLScript functions and
WMLScript returns the final variable values back to the
WML-document. Go and some event elements (like
refresh) can have variables with the
setvar element, which can set and initialize
variables. In most cases variables are used with form elements.
The element postfield is especially designed to use
with form elements, to transfer the variable information. It is
used inside the element go, which can have many
postfield elements.
Some examples how to use form elements in order to transfer information:
option (inside the element
select)with the onpick attribute(no variable information) |
> go (commonly inside the
do element) |
|
option |
> postfield(with variable information) |
|
input |
> postfield(with variable information) |
WML with WMLScript encoding resemble for example
JSP, ASP, PHP3 and Perl
encoding. Compared to JSP (I was in a course to know something
about it) it seems to be easier. Functions (or methods) are
always used from external files. The result can be used like
among ordinary text just using variable signs ($) -
for example Perl use the sign before the variable name (in the
WMLScript the variable declaration use the var keyword
like JavaScript). It doesn't need for example <?php3
...?> or <% ...%>. Below is an
example of how to use variables with a form elements.
...
<!-- The function call -->
<go href="/myscript.wmls#myfunction('answer',$(integer)"/>
...
<!-- They user action -->
<input format="*N" name="integer" title="Integer:">
...
<!-- Here is the answer; The variable value becomes from a WMLScript -->
$(answer)
WML has many strict element orders, which are defined in the DTD-file like in W3C HTML recommendations. Below is an example of a valid and well-formed WML-document:
<?xml version="1.0"?>Hello paragraphs!
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN"
"http://www.wapforum.org/DTD/wml12.dtd">
<wml class="root">
<card class="card" id="card1" title="The order">
<onevent type="onenterforward">
<go href="error.wml" />
</onevent>
<timer value="100" />
<do class="button" type="accept" label="Forward">
<go href="#card2" />
</do>
<p>
<b></b>If the
</p>
<p class="left">
<i class="code">card</i>or<i class="code">template</i>element has the<i class="code">onevent</i>element, it must be first. If the<i class="code">card</i>element has the<i class="code">timer</i>element, it must be after the<i class="code">onevent</i>element and before all<i class="code">do</i>,<i class="code">p</i>or<i class="code">pre</i>tags.<br />
Elements<i class="code">p</i>or<i class="code">pre</i>must be as the parent element to all other elements, which don't require<i class="code">do</i>as their parent. Some elements can or must be nested (then those three elements are as ancestor elements to some other elements). Remember the correct element order also, when you create forms and tables!<br /i>
In this<i class="code">card</i>inside the element<i class="code">do</i>the attribute value<i class="code">Forward</i>creates a button text<i>Forward</i>to go to the second card (card2).
</p>
</card>
<card class="card" id="card2" title="A table example">
<p><strong>
<table columns="3" align="LCR">
<tr>
<td>Cell1</td><td>Cell2</td><td>Here is the second card, which has a table!
The elementtablemust be inside theporpreelement.
According to the DTD also text layout elements can work as parent elements.
Nested tables are not allowed!</td>
</tr>
</table>Go to the next card!
</strong></p>
<p>
<b><a href="#card3"></a></b>Swim
</p>
</card>
<card class="card" id="card3" title="A form example">
<do type="accept" label="Go to test">
<go method="post" href="/test.pl">
<postfield name="test" value="$(test)" />
</go>
</do>
<p align="center">
<select iname="test" ivalue="1">
<option value="Swim"></option>Bike
<option value="Bike"></option>Run
<option value="Run"></option>
</select>
</p>
<p>
<img src="../Taulut/Tools.gif" alt="Image test" />
</p>
</card>
</wml>
Test this page with a system DTD-file and a style sheet in a new window, if you have a WML-capable user agent (look at WML-capable user agents and tool kits). I have tested the functionality of this example WML-document with Opera 4.02 and Opera 5.01.
W3C.WML 1.2 doesn't support CSS, but in principle it
would be easy to develop WAP CSS profile. Core attributes
id and class could be used also in WML
creating CSS-rules. Future versions of WML might support CSS.
If the presentation of WML elements is defined with standard and necessary proprietary CSS, the WML-browser doesn't need two rendering engines. CSS could define both the basic layout and special layout, where the author writes his own CSS-rules. Opera 4.x is example of this kind of solution, because it define the presentation of WML-documents primary with a CSS configuration file (wml.css); If the whole presentation is defined with CSS, a little bit more proprietary CSS is needed than Opera Software has used.
It is however very reasonable to use CSS in sites, which should be converted into WML. The optional situations is that normal web pages are designed according to the ideals of XHTML 1.0 Strict. You might ask why, if WAP doesn't support CSS? Here is some answers:
<p class="some">
Here is a paragraph with line breaks,<br />
which are valid also to WML-document.<br />
WAP browsers would not tolerate this text as ordinary HTML.<br />
</p>
I don't however recommend to make sites according to HTML 4.01/XHTML 1.0 Strict, if the purpose is to get some level reasonable presentation to old web browsers. I use in normal text documents either HTML 4.01 transitional or XHTML 1.0 Transitional document type. It is easy to check with HTML-Kit, if XHTML is valid (because of HTML-compatibility) and well-formed (because of XML-compatibility).
Note. Remember to use *.html
extension in XHTML files, because IE 5.0 Win interprets with
*.xml extension XHTML as XML. This means that attributes and
elements lose their common tasks. Remember also, that XML
documents need always XML style sheets (for
example <?xml-stylesheet href="xml-sheet.css"
type="text/css"?>) in order to get the presentation
(remember that non-XML browsers can't use this declaration and
they need link or style elements).
Without style sheets IE displays just the source code. If the
defined style sheet is not found, the text has no formatting - it
is like a text file with word wrapping. I don't know, how IE 4.5
or IE 5.0 behaves, but I presume, that IE 4.5 MAC would behave
like MS IE Win 5.0.
It is not possible to get proper presentation to XML document
to MS IE 5.0 Win by using standard style sheet languages. IE 5.0
supports proprietary XSLT and future versions of MS
IE need conversion from the proprietary XSLT into real XSLT ,
which is made according to W3C recommendation
(11/1999). The CSS-implementation has too much missing properties
in order to create proper structures to XML-documents with CSS.
Maybe IE 5.5 gives the possibility to create fine XML-document by
using XSLT and CSS, if the company just not have too tight time
schedule and it doesn't try to bee too "innovative" creating new
proprietary extensions to web pages. At least Opera 4.x, Opera
5.0 and Netscape 6.x can create quite good
presentations to XML-documents only with CSS (indeed CSS2 has
some missing form implementations, which will be added to CSS3
.
WAP servers make conversions between HTML and WML. Because WML can't have errors, it is recommended to create valid HTML or rather valid and well-formed XHTML-documents. Using XSLT it could be in some cases easy to make conversions between different XML-based languages like WML and XHTML. This document is an example of valid and well-formed XHTML document, which might be relative easy converted with Perl (and in principle also with XSLT) to WML (nested list elements might create some problems).
WAP Servers use primary Perl and Java-servlets into automatic generating of web pages. Then you should learn to use at least another of them. Pekka Niskanen doesn't handle XSLT and I don't know yet the possibilities of XSLT in WAP servers. Some WML resources handle document, which are made with another XML-language than WML. The most reasonable in many cases is XSLT. My fried said, that it is also possible to use other CGI-techniques like php3 and asp.
In my mind all kinds of conversions are problematic. Hard automatic conversions mean certainly loss of information. I doubt that the final document is always readable. Especially form elements create much headache to create proper conversion between XHTML and WML. Because nested tables are not allowed in WML, the document structure of XHTML documents should be as simple as possible. Nested lists create problems. Instead of nested list elements, it could be better to use tables to create the first level list presentation. Inside a table cell can use an ordinary list. At this way can create some kind of two level list presentations, which can be converted into WML without serious problems. If the basic XHTML document is simple enough, the conversion is possible without great loss of information.
In theory it is possible to use the class
attribute in server side conversions. This could be used to
maintain conversions in both directions <div
class="card"> => <card
class="card"> => <div
class="card">. The class attribute is
intended just to this purpose according an e-mail, which I got
from a designer of WAP-systems:
The class attribute is intended solely to assist with server-side transformations, so you can use it if it is helpful, but there's no standard processing defined for it.
The problem is that class names should be defined so, that the element name can't be mixed to anything. I put class-attributes to the example page in order to demonstrate how to use class-attributes in possible conversations. Different attributes are still problematic.
Because structures of forms are today so different in XHTML and WML, when both documents have forms, they are reasonable to tailor to both document types and include them into the main documents.
In theory it could be the possibility to create third language, which cover all XHTML and WML elements and attributes. Then final documents are always converted either to XHTML or WML.
The next version of WML, WML 2.0 base on primary XHTML Basic™ and special WML 1.2 elements and attributes, which are added through a namespace, which use the prefix wml (for example wml:card). XHTML Basic base on the Modularization of
XHTML™, where XHTML is divided into smaller pieces, so called modules. WML 2.0 has for example all ordinary form control elements and it supports style sheets related attributes and elements. In addition of complete modules, WML 2.0 has some fragments from modules, which don't belong to XHTML Basic (for example from the Legacy Module) in order to get better backward compatibility. Because WML 2.0 supports CSS, most presentational fragments (for example the element U) are in principle unnecessary. I have made both WML 1.2
and WML 2.0
tables.
Because new version of WML has been made, the main question is, how much is reasonable to write WML 1.0-1.2 documents?
Before WML 1.2 WAP devices have used HDML (Handheld Device M arkup Language), which Phone.com supports. WML and WML base partially on HDML. WML is intended to replace HDML. HDML is not an XML-based languages, because it doesn't fulfil XML-requirements as you can see from this example HDML-document (this is from the submission of W3C):
<HDML version=2.0> <DISPLAY> <ACTION TYPE=ACCEPT TASK=GOSUB DEST="#subact" RECEIVE="var1;var2">var1 = $(var1)<BR>var2 = $(var2)</DISPLAY><DISPLAY NAME=subact> <ACTION TYPE=ACCEPT TASK=RETURN RETVALS="abc;xyz">Return abc;xyz</DISPLAY> </HDML>
Instead to the element card is used the element
DISPLAY. I don't know, if transformation between
HDML and XHTML will be easier than WML and XHTML. I some
districts it might be reasonable to use HDML. Some WAP Servers
can automatic make conversions between them even if HDML is not a
XML-based language.
Resembling language is also CHTML
(Compact Hyper Text Markup Language), which is SGML-based language. In fact it is just a collection of HTML 2.0 - HTML 4.0 elements and attributes. WML 2.0 (without special WML-extensions) is quite close it. If WML 2.0 special elements (for example wml:do) and CHTML obsolete elements (for example LISTING) is not used browsers, which support CHTML or WML 2.0 should be able to read both document types (so-called empty elements must mark so, that there is a space between the termination, for example <img ... />).
All elements, which have termination tags can be used by enclosing them into a selection even if the button hint is Insert.... The result is however different concerning line breaks. I give some recommendations, how to use buttons:
wml, card, template,
table, tr, anchor,
do, onevent, prev,
refresh, go, option and
select. If you use them by enclosing into a
selection, you might need to add or remove a line break.head, fieldset and
optgroup. If you use them by clicking a button, you
get an additional line break.p by enclosing a text
into a selection, the end-tag is in the same row as the end of
the text. It can be used however in both ways and the result is
acceptable.b, a (the same anchor element as
in HTML) and td (the element tr create
line breaks).I have listed all keyword values, which are listed in the book
INSIDE WAP. They don't consist all possible values to the
elements meta and input. Information about some attribute
values:
content="max-age=?" http-equiv="Cache-Control"
the value is in seconds.value-attribute inside the
timer element is in 1/10 seconds.align-attribute inside the table
element is a list of keywords without spaces (like
align="LCR". They should be set as much as columns.
The first keyword refer to the first column and so on.title attribute to anchor elements and the
label attribute to the element do is
recommended to be maximum six characters.format attribute of the
element input are:
six numbers+
-+
three numbers+
any character.
If you try to test WAP-documents with common xml user agents
and you are not connected to the Internet, you require a local
DTD-file. The the DTD-declaration should be similar to
<!DOCTYPE wml SYSTEM "wml.dtd"> instead of
<!DOCTYPE wml PUCLIC "-//WAPFORUM//DTD WML 1.2//EN"
"http://www.wapforum.org/DTD/wml12.dtd">.
If you have installed MS IE 5.x, HTML-Kit with MS IE as the internal rendering engine (or MS IE 5.0 alone) can work as XML-encoding validator to check, that the code is well-formed. MS IE is that it informs about the place of encoding error and it is easy to fix encoding errors by using MS IE 5.0. Indeed it is easier to test the well-formedness (and optional also the used DTD) with a special XML-validator plug-ins, because then it is not necessary to use the preview.
Without using a style sheet (in this case CSS file) you can see the source code (test TestWml0.wml with MS IE 5.x - note, that links to test pages open always into another window). Using a style sheet you can see the text at some level formed (test TestWml.wml with MS IE 5.x). But you can't test the functionality of WML-documents with MS IE, because MS IE 5.0 doesn't give proper presentation to WML-elements and linking elements don't work.
Opera 4.x has experimental support for WML which lets users surf WAP sites directly from their desk tops.
Opera 4.x displays the element do quite the same
way as Nokia WAP Toolkit 1.2 and the elements
select + option like a HTML-browser. In
WML is not defined how user agent should render them. Even if it
render them differently as some mobile phones, it gives them
proper presentations because user agents have great freedoms.
Opera 4.x does have however some difficulties. It displayed the WML-document without my own style sheet (TestWml0.wml), but it crashed when I tried to select the next card or it doesn't go to the next card.
This matter is however easy to fix, because Opera use a
CSS-file as the configuration file to define, how to render
WML-elements except the elements select +
option, which Opera renders always at the same way
as in HTML. Find the file wml.css from the root
directory of Opera 4.x. The element do is poorly
defined in the CSS-file. Opera 4.x does have also some other
matters, which it doesn't display properly. If you edit the
CSS-file at the following way, it gives proper presentation to
almost all WML-elements (if you test the effect, you must restart
Opera):
/* Edit the following rule in the wml.css so that it looks out following: */
do {/* I recommend to use a width-value.*/
border: outset 2px black;display:block;margin:auto;width:50%
}
/* Add following CSS: */
strong, b {font-weight:bold;}/* If you want that Opera renders align-attributes like a real WML-browsers, they must be defined with CSS at this way. */
i, em {font-style: italic ;}
u {text-decoration: underline ;}
big {font-size:larger}
table {display: table;}
tr {display: table-row }
td {display: table-cell }
pre {white-space: pre}
p, p[align="left"]{text-align:left} /* If you want that Opera render the text as left-aligned, which is the recommendation as default. value in WML. */
/* You can add also more CSS rules, if you want more exact presentation, for example these rules: */
p[align="right"]{text-align:right}
/* It is however impossible to define text-align to tables at this way, if table cells have different alignment values */
/* The need of additional rules depends on which attributes you use in WML-documents. */
You can alternative download wml.css,
which I have edited ready for you. Replace with that file the
original configuration file. I have made some changes, which you
can set back (original setting are inside CSS-comments (/*
... */) and I have informed, what properties I have
altered). Or download Opera 5.x, which has completely new
wml.css file (if you have used Opera 4.x Opera 5.0
doesn't use the CSS-file of Opera 4.x, because the new file is in
an another directory). You can also edit the CSS-file of Opera
5.0, if you don't like the default style (it is in the
sub-directory Styles of Opera 5.0). If you are not
sure, don't do anything, because the configuration file use
advanced features of CSS2 and it has some proprietary
properties.
Opera 4.x shows as default everything as 20px (you can however
change the value). I added to the class code special
color to get better explanations. Look at TestWml.wml and use 70% zooming. Shrink then
the window about 95x65, you can see the document like in some
mobile phone of Nokia (Nokia Toolkit 1.2 emulate
this window size). Adjusting the size of the window, you can
emulate some other mobile WAP phones.
Opera doesn't render images but the alt-text. You can alter
the configuration file to show instead of it the file name or
both the file name and the alt-text (exchange from
img:before { content: attr(alt);...} to
img:before { content: attr(src);...} or
img:before { content: attr(alt) " - " attr(src);...}
- the hyphen and spaces are to separate attributes from each
others). You can also affect to the presentation of the
alternative contents.
The disadvantage of Opera 4.x is that it doesn't show, where is the encoding error (it just says "XML-parsing failed", if there is encoding errors). This is fixed in Opera 5.x, which tells, in which row and after which charcter the page has the first error or where the error causes a mismatching syntax. When you fix the first error, if you reload the page, it shows the possible next error and so on. You don't need anymore another application (like MS IE 5.x) to check the syntax (I don't know, if Netscape 6.x displays encoding errors). Opera 5.x can today get free as ad-sponsored (it has advertisements) version (I you don't want to see advertisements, you must pay the registration fee, which is 39$). Because it can render both (X)HTML and WML documents it is quite useful testing both document types. I doesn't however support WMLScript.
Some tool kits and WML-capable user agents (I can add more, if someone wants to give the address) and necessary additional components:
Most of those applications need also some Java application from Sun and Perl support. Most of them work in Windows 95/98 but at least Nokia WAP Server needs Windows NT 4 or 2000. I hope that I could find somewhere an address to a WAP-server, which works in other platforms. Send e-mail if you know them.