Declaring Web applications with AppML (1/2) - exploring XML | WebReference

Declaring Web applications with AppML (1/2) - exploring XML

Declaring Web applications with AppML

Writing Web applications is a lot of work: Creating forms, programming business logic, developing database access. As part of the Mozilla project, the Extensible User Interface Language (XUL) created a lot of buzz around the concept of declaring -- rather than programming -- user interfaces. Instead of writing code in a particular programming language, an XML document contains a description of all the used GUI elements and their connections.

Along these lines, fellow XML site author Jan Egil Refsnes has developed an XML vocabulary for defining whole Web applications: Application Markup Language (AppML). While XUL is still awaiting its first use in a major application, Jan has implemented a complete Web application for the Norwegian Handball Federation in a fraction of the time it would take with conventional tools.

AppML is built around a handful of concepts that should be familiar to every Web application developer:

Database

The <database> element defines a record set in a database, by specifying a main table and optionally a SQL select statement for the subset of data to be worked on, as well as the primary key fields for that table. An example for a CD collection could look like this:

<database>
  <connection>music_db</connection>
  <maintable>cd_catalog</maintable>
  <sql>select * from cd_catalog</sql>
  <keyfield>cddb_id</keyfield>
</database>

Reports

Reports are read-only representations of data in table format, specified by a database element like above. Various elements can be used for specifying the layout of the report table, defining headers and footers. Defaults are provided for all options in order to achieve results quickly:

<htmlreport>
<sql>
select artist, title from cd_catalog where year=1997;
</sql>
<header>
<h1>Michael's CDs of 1997</h1>
</header>
<footer>
courtesy of AppML
</footer>
<table border="0" class="app">
<thead>
<tr>
  <th class="cdheader">Artist Name</th>
  <th class="cdheader" align="left">CD Title</th>
</tr>
</thead>
</table>
</htmlreport>

the other concepts...


Produced by Michael Claßen

URL: http://www.webreference.com/xml/column69/index.html
Created: Nov 25, 2002
Revised: Nov 25, 2002