Data, its presentation and user interface forms

CMS

XML has acquired a distinguished popularity lately. No one doubts its perspectives of overall use. The concept of semantic web is no longer an abstraction and is implemented into life with confidence. In the world net’s information cacophony there appears harmony. In the hands of talented conductors such as W3C, ISO, OASIS it can diversify into a symphony.

Today XML family has so many standards available that it seems there should be quite enough for all possible aspects of information technology world. It is generally so. But let’s see how XML era has influenced ordinary web development tasks.

To deliver information to a user a site is needed. Web site content should be managed and that involves separation data from its presentation. The task is still often solved with the help of templates in program technologies. Though now we have XSLT technology at our disposal. Any document can be represented with data that is structured in detail with the help of XSL. It is quite enough to report the corresponding XSL template to define a proper graphic presentation for the data. XSL language is polymorphous and permits high flexibility in format changes of documents.

This might seem to be St.Grail of web development - we add XSL tools to our arsenal and shorten the time of the project development thus raising its quality.

However if we analyze time spent at creating a web project, it turns out that programming of user interfaces takes the most time. It is one thing to fill in the information, to deliver it to the user, and it is another thing to reconstruct multifunctional and easy to navigate interface. The tendency of content volume growth in the Internet is also worth mentioning here which makes effectiveness of user interfaces even more important.

XSL technology gives opportunities for managing document’s presentation theoretically with any form of user interface. With its help the state of user interface can be analyzed and algorithms for data presentation be created depending on the conditions. But XSL operates XML data and it is necessary to prepare corresponding XML data file to assign an ordinary navigation menu in XSL.

In practice it turns out that XSLT template layers contain a mixture of user interface forms and presentation algorithms. Moreover the logics of user interface database forming is duplicated in CMS program code. How to avoid unnecessary program coding? How to achieve more visual presentation for user interface form algorithms?

In October 2004 Red Graphic Systems company published XML Sapiens specification. This technology aspires to take the place of a layer between XML and XSL. When XML Sapiens processor meets a link to a file with user interface forms' script, initial XML file is broaden with appropriate data. Let’s suppose we want to form a vertical site menu page. We will need to create a script file (interface.sapi) and to describe a user interface form in it (DDC menu). We indicate that under any environment conditions we want to have reflection of the whole menu content. Using sapi:for-each construction, we can request any necessary data from CMS system function.

Then we manage enumeration of the data. We specify what exactly and in what cases should be returned within enumeration process. To send data dynamically formed by script to the initial XML-file we only need to arrange pointers. That means that after script file interface.sapi analysis XML Sapiens processor will broaden initial XML data file to the extent that is necessary for the following XSLT transformation.

Initial XML

<?xml version=“1.0” encoding=“UTF-8”?>

<?xml-stylesheet type=‘text/xsl’ href=‘template.xsl’?>

<?xml-sapi type=‘text/xml’ href=‘interface.sapi’?>

<content xmlns:sapi=“http://www.xmlsapiens.org/spec/sapi.dtd" xmlns:xlink=“http://www.w3.org/1999/xlink">

<data1>data1</data1>

<data2>data2</data2>

<menu><sapi:apply name=“ddc.menu.value” /></menu>

<title><sapi:apply name=“qc.title.value”></title>

<publication><sapi:apply name=“qc.publication.value”></publication>

</content>

XML Sapiens file script interface.sapi

<?xml version=“1.0” encoding=“UTF-8”?>

<sapi version=“1.0” xmlns:sapi=“http://www.xmlsapiens.org/spec/sapi.dtd">

<sapi:ddc name=“menu”>

<sapi:choose>

<sapi:when exp=“TRUE”>

<sapi:for-each select=“get_tree()">

<sapi:choose>

<sapi:when exp=“TRUE”>

<sapi:code>

<row id=”” activity="">

<link><sapi:apply name=“this.this.href.value” /></link>

<item><sapi:apply name=“this.this.title.value” /></item>

</row>

</sapi:code>

</sapi:when>

</sapi:choose>

</sapi:for-each>

</sapi:when>

</sapi:choose>

</sapi:ddc>

</sapi>

XML Sapiens script algorithm (interface.sapi)

XML Sapiens script algorithm (interface.sapi)

Final XML

<?xml version=“1.0” encoding=“UTF-8”?>

<?xml-stylesheet type=‘text/xsl’ href=‘template.xsl’?>

<content xmlns:sapi=“http://www.xmlsapiens.org/spec/sapi.dtd" xmlns:xlink=“http://www.w3.org/1999/xlink">

<data1>data1</data1>

<data2>data2</data2>

<menu>

<row id=“01” activity=“1”>

<link>/intro/</link>

<item>Introduction</item>

</row>

<row id=“02” activity=“0”>

<link>/chapter1/</link>

<item>Chapter 1</item>

</row>

<row id=“03” activity=“0”>

<link>/chapter2/</link>

<item>Chapter 2</item>

</row>

</menu>

<title><![CDATA[Introduction]]></title>

<publication><![CDATA[<p>Content</p>]]></publication>

</content>

It should be admitted that transfer of CMS instructions and receiving of the requested data from the script directly make web development process much easier. Such approach gives opportunity to disengage from the system language programming. Taking this into consideration the document content to be administered can be requested from CMS in XML Sapiens script directly. You just place the corresponding markers in the initial XML.

It is hard to predict XML Sapiens' perspectives now. Unlike above-mentioned XSL, it is not an approved W3C standard. Though the tasks covered by XML Sapiens specification such as separation of user interface form algorithms from data presentation, clearness and availability of algorithms descriptions, are quite up to date. This project might attract the attention of developers' community. That could result in appearance of new technologies able to increase the quality and profitability in web development.