to the main page about the tutorial  INTERACTIVE WEB SERVICES WITH JAVA back up next

The XML Class

Template are implemented by the XML class.

An XML object corresponds to an XML fragment possibly containing named gaps.

The XML class offers the following features:

The JWIG system allows elaborate syntactic sugar for these constructions.

A template constant is written as:
[[ <table border="0" cellspacing="0">
     <tr><td align="left">
       <a href=[js]>
         <img border="0" src="http://www.brics.dk/~mis/file.gif"/>
       </a> 
     </td></tr>
     <tr><td align="left">
       <[name]>
     </td></tr>
   </table>
  <[rest]> ]]
where js, name, and rest are gaps.

Templates are plugged by writing, for instance:
options = options<[rest=templateOption<[inx=versionInx(contents[i]),
                                        date=versionDate(contents[i])] ];

This is different from JDOM documents in the following ways:

- and different from Servlets in the following ways:

back COPYRIGHT © 2002-2003 ANDERS MØLLER & MICHAEL I. SCHWARTZBACH next