type of compression. It only has to download the
data and then it can already be processed without
any manipulation.
• To submit the queries it is created a HTTP connec-
tion and the message coded in XML (according to
the XForms standard) with the provided values is
sent to the application placed in the server using
POST as request method.
2.4 Forms support
2.4.1 XForms
The forms the application uses follow the standard
XForms (Micah Dubinko, 2003). XForms is an
XML application that represents the next generation
of forms for the Web. By splitting traditional XHTML
forms into three parts - XForms model, instance data
and user interface - it separates presentation from con-
tent, allows reuse, gives strong typing - reducing the
number of round-trips to the server, as well as offering
device independence and a reduced need for script-
ing. XForms is not a free-standing document type,
but is intended to be integrated into other markup lan-
guages, such as XHTML.
XForms has been designed on the basis of several
years’ experience with HTML forms. HTML Forms
have formed the backbone of the e-commerce revo-
lution, and having shown their worth, have also indi-
cated numerous ways they could be improved.
The primary benefits of using XForms are (W3C,
2003):
• XForms improves the user experience: it is
achieved by giving immediate feedback to what is
being filled in.
• It is XML, and it can submit XML.
• It is device independent.
• Integration with Web services.
• It is easier to create complicated forms.
Our system doesn’t implement all the characteris-
tics of the XForms specification, but rather it has been
selected a reduced set of properties and elements con-
sidered enough (this set can be increased in future
works):
• Elements: instance and bind
• Properties: type, readonly, required and
constraint.
• Controls: input, secret, select and
select1.
2.4.2 Parsing
Once the form is obtained, it should be processed to
extract the information that contains. The responsible
for this task is a small XForms parser that, in turn,
uses a XML parser.
The XML parser used is a pull parser. XML pull
parsing (Slominski, 2002) is an alternative to push
parsing approach that is very well suited for process-
ing every element of a XML document in a streaming
fashion. In push parsers the code of the user is called
by the parser when an interesting part of XML input
is available and it is a responsibility of the code of
the user to keep the state between callbacks. That is
the main difference with push parsing: when using a
XML pull parser the user code is in control and can
pull more data when it is ready to process it.
Due to the limitations of the devices, the mo-
bile application needs a XML parser with small size
(hardly some kilobytes) and low memory usage. It
has been decided to use pull parsing, and, inside this
type of APIs, the kXML 2 one. kXML 2 (Source-
Forge.net, 2003) is a compact library which pro-
vides a XML pull parser and writer suitable for all
Java platforms including the Java 2 Micro Edition
(CLDC/MIDP/CDC). Because of its small footprint
size, it is especially suited for Applets or Java appi-
cations running on mobile devices like Palm Pilots or
MIDP enabled cell phones. kXML 2 is licensed un-
der the BSD license. In (Balani, 2003) you can get an
example of use.
The result obtained after the parsing of the docu-
ment is a group of objects, each one of them with
J2ME graphic elements and a set of associated vali-
dation elements. Those graphic elements will be dis-
played on the screen, while the restrictions have to be
checked for the values provided by the user.
2.4.3 Validation
One of the most innovative aspects in the developed
application is the local validation in the own device
of the values provided by the user for the different
fields (making use of the support XForms gives for
that purpose).
The term local validation refers to the validation
that is carried out using the logic stored in the own
device, without having to send the information to an
application in a server to be validated there.
Each object of the J2ME application that represents
a field will has associated a visual part and a set of
constraints. When an user provides a value to a field,
if the value doesn’t verify the constraints associated to
that field, it will be displayed an alert screen with in-
formation about the format that the value should have.
That alert will be shown again and again until the field
would be correctly filled.
ICETE 2005 - WIRELESS COMMUNICATION SYSTEMS AND NETWORKS
122