README

This package XTiSP is distributed under the terms of the GNU 
General Public License. (see the COPYING file)


-- SUMMARY --
   
  XTiSP is an implementation framework for XML transformation languages
through derivation of stream processors. Using XTiSP, we can automatically
obtain XML stream processors from the specification defined by XML tree 
manipulation. The algorithm is based on the composition method of attribute
grammars. If an XML transformation is defined by an attribute grammar
over XML trees, XTiSP will produce an XML stream processor.

Currently XTiSP provides two original languages, XTAG and XTiSP, which
can be transformed into attribute grammars:

 * XTAG is an attribute grammar over binary-represented XML trees.
 * XTiSP/IV is an XML transformation language using iteration based on 
  XPath.

XTiSP can produce an XML stream processor from a program written in 
XTAG or XTiSP. Besides these languages, the following languages will
be supported:

 * XSLT   - nearest future
 * XQuery 
 * XDuce or CDuce




-- INSTALL --
 The installation requires Objective Caml-3.07 and ulex-0.4 (a side 
product of CDuce). If they have already been installed, the installation
of XTiSP is done as follows:

1. Download the latest version of XTiSP.
2. Extract the tar ball (.tar.gz file).
3. Configure with some options you need:

  % ./configure --with-ulex=/usr/local/lib/ocaml/site-lib/ulex

   Do ./configure --help for detail. Even if you configure with the
  option --disable-opt, you can produce an native code for an XML 
  stream processor you want. The option is used when you don't want
  the high-performance native-code compiler xtisp.opt.

4. Compile and install.

  % make
  % make install




-- USAGE --

xtisp [ file | -ag file | -xtisp file ] [ -o program ] [ -T Output_type ] \
      [ -opt ] [ -i ] [ - input.xml output.xml ] [ -clean ]

  file
  -ag file
  -xtisp file
    The string 'file' is the name of the program source file for XML 
   transformation. The programming language is detected by the suffix
   of the name: XTAG if .xtag, .ag or .sag; XTiSP if .xtisp or .xt .
   You can specify the language by options '-ag' or '-xtisp'.

  -o program
    The name of the obtained program. If '-T' option is used at the 
   same time, the program is obtained as an intermediate code in a 
   stage which is specified by '-T'.

  -T intermediate_stage
    The command outputs in a stage which is specified by '-T'. You can
   use 'ag', 'tt' or 'sp' as intermediate_stage: if 'ag', it outputs 
   an attribute grammar over XML trees; if 'tt', it outputs a tree 
   transducer corresponding the attribute grammar; if 'sp', it outputs
   a tree transducer which is obtained by the composition with an XML
   parser. Most of people don't have to use this option.

  -opt
    Output the native code program. If you have 'ocamlopt', you can use
   this option.

  - input.xml output.xml
    Direct mode. We can directly transform from input.xml to output.xml
   by a given XML transformation program. Even if you use this mode, 
   the program is compiled. Therefore you should use this option just
   for testing your program.

  -i
    Use the program in interactive mode. It is used to checking that the
   program behaves a desirable processing. If you use this option, the 
   command wait an input XML text and returns some outputs as many as
   possible.

    % xtisp -i bar.xtisp
    <article>
           -> <HTML><HEAD>
    <name>
           -> <TITLE>
    XTiSP</name>
           -> XTiSP</TITLE><BODY>
    </article>
           -> </BODY><HTML>

     If the input is only character data, anything will not be output
    because of XML lexer. The lexer is waiting for the end of the 
    character data such as open/close tag.

  -clean
    Clean temporary files created by XTiSP. You had better do 
     % xtisp -clean
   at odd moments since XTiSP creates some temporary files during 
   compilation.




-- DOCUMENTATION --

Currently the XTiSP package contains only poor documentation. Please
check the XTiSP website (http://xtisp.psdlab.org). The documentation
about XTiSP will be added in the near future.

As for XTiSP/IV, the package provides the following files may be a
useful tutorial:

	01_element.xtisp
	02_non_element.xtisp
	03_xpath_querying.xtisp
	04_before_notation.xtisp
	05_invite_loop.xtisp
	06_visit_loop.xtisp

The following sample programs are provided:

	oldtonew.xtisp
	playhtml.xtisp
	samurai.xtisp

