logo of XML Sapiens
SapiProcessor

About XML Sapiens?

Introduction

XML Sapiens is an XML based language for user interface form algorithm descriptions.

XML Sapiens is aimed to help at cutting down time expenses in a web-project development thus lowering project's cost and to minimize laborious system programming in web-site development. It is achieved by providing tools for user interface form logics management. By user interface forms here we mean fragments of a document able to change its state depending on user's actions.

XML Sapiens concept presumes division of a document into abstract layers: data, presentation and algorithms for user interface forms.

XML Sapiens and XSLT

Any web document can be logically divided into data and their presentation. Besides, a web document as a rule contains elements of user interface (navigation, forms for information input, ect.). In compliance with W3C recommendations, document presentation in spite of its data is managed by XSLT technology (http://www.w3.org/TR/xslt). Document's data are placed in an XML file and changed according to XSLT template rules. With the help of XSLT it is also possible to assign presentation for user interface forms, but initial data of these forms in the XML file are necessary for such a change.

XML Sapiens allows defining data source for each user interface form as well as describing the forms' logics. XML Sapiens' processor will analyze developer's instructions and will broaden the initial XML file with user interface forms' data for the current environment state. Based on the data received from the XML file, XSLT transformer will create the final form of the document.

Thus XML Sapiens helps to separate abstract constituents of a web-site: data, presentation and user interface.

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 sapi:id="this.this.id.value" sapi:activity="this.this.currentpage.value">
                     <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> 

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> 

Displayed document formation chart

Displayed document formation chart
© 2004 Red Graphic Systems. All Rights Reserved. Red Graphic Systems liability, trademark, document use and software licensing rules apply. Your interactions with this site are in accordance with our public and Member privacy statements.