<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<?modxslt-stylesheet type="text/xsl" method="http" href="${xsltRoot}/translator.xsl" 
	media="screen and ! $GET[format]" alternate="no" title="For any web browser" charset="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" method="http" href="../xslt/sdope/docbook.xsl"
	media="screen" alternate="no" title="For any web browser" charset="ISO-8859-1"?>
	
<!--
   mod-xslt - Copyright (C) 2002, 2003 Carlo Contavalli 
 			 <ccontavalli at masobit.net> -->


<article xmlns="http://www.masobit.net/ns/sdope/1.0">
  <articleinfo>
    <title>Introducing mod-xslt2</title>  

    <author>
      <firstname>Carlo</firstname>
      <surname>Contavalli</surname>
      <affiliation>
        <address>
          <email>ccontavalli at masobit.net</email>
        </address>
      </affiliation>
    </author>

    <abstract><para>
    Why should I use mod-xslt2? What can I do with 
    mod-xslt2? Why did you spend your time on mod-xslt2?
    Those are some questions this document will try to 
    answer.
    </para></abstract> 
  </articleinfo>

  <sect>
    <title>XML and XSLT</title>

    <para>                                                 
    As many of you already know, xml is a relatively new
    language studied to represent any kind of information 
    using simple text files.
    </para> 

    <para>
    The nicest thing about XML is that it is used
    to store data, but it does not carry information
    about how that data should be displayed (rendered) 
    on a generic media (like a screen, or a printer, ...).
    </para>

    <para>
    Informations about how to render XML files on a
    given media are carried along in Stylesheet files, 
    either CSS version 2 or XSLT stylesheets.
    </para>

    <para>
    XSLT is a generic language which can be used to transform
    XML files to almost any other language or format. It is most used
    to convert XML files into HTML files (to be displayed
    on a screen) or to FOP (to be printed or converted to PDF).
    </para>

    <para>
    By having a file carrying the data and one
    carrying informations about how that data should
    be rendered on a device, you can separate the 
    task of writing your web softwares from that
    of designing good and nice interfaces.
    </para>
  </sect>

  <sect>
    <title>XML and the Real World (tm)</title>

    <para>
    This separation allows you to have a designer prepare the 
    graphics of your internet site and a programmer write down 
    the needed scripts/tools, improving the quality of the whole 
    result. As you probably know, most programmers are not good 
    at web design, and most designers are not good programmers.
    </para>

    <para>
    Although many companies are nowdays pushing the 
    XML market by commercializing their wonderful XML support,
    very few products do have even a good support for
    it. As usual, many of them developed their own 
    extensions or decided that the standards were not 
    that good to follow, and made their products
    incompatible even with different versions of 
    themselves.
    </para>

    <para>
    Talking about the world of ISP, the result is 
    that most browsers do not support rendering XML
    pages using XSLT stylesheets, and even when they 
    do, they perform a poor job, generating a different
    HTML output every time you refresh your page or
    every time you switch from one version to the next 
    one of the same software, or just generating the
    <bf>wrong result</bf>.
    </para>
  </sect>

  <sect>
    <title>mod-xslt2 comes to help</title>

    <para>
    The idea behind mod-xslt2 is to cut away all
    those kind of problems and to parse xml 
    files into HTML (or any other format) 
    before they even get to the browser.
    </para>

    <para>
    That way, you will be sure the document
    will produce the same HTML on every request,
    and that any browser will be able to display 
    your XML pages.
    </para>

    <para>
    The browsers accessing your web site 
    won't have direct access to your XML data,
    and you will be able to protect it from 
    those who may just decide to store your 
    .xml pages on their databases and use 
    them by themselves, unless you decide
    to allow it (now it's your choice).
    </para>

    <para>
    As you probably may guess, this site is
    a direct result of using mod-xslt2: its
    graphic was made by a designer on its
    spare time, without knowing anything about
    the php scripts I was going to write/use... 
    None of us alone would have been able
    to reach such a good (I believe) result.
    </para>
  </sect>

  <sect>
    <title>Why did you spend your time on mod-xslt2?</title>

    <para>
    Nowdays on the internet you can find many apache modules 
    or web components able to parse XML into HTML.
    </para>

    <para>
    Some of them depend on a particular scripting language 
    being used or require web developers to user their routines
    or their libraries for the XML to actually be parsed.
    </para>

    <para>
    Others can be thought as components of the
    web server and work mostly like mod-xslt2. 
    However, many of them have lot of 
    limits: they can't fetch XSLT from remote servers
    or from dynamic scripts, they can't parse the
    output of PHP or CGI, they only work with one
    particular version of a web server and none of 
    them (I know of) is able to choose a different 
    XSL to use depending on the conditions the XML 
    was asked. 
    </para>

    <para>
    While providing most of the standard features,
    mod-xslt2 has some extensions that when used 
    correctly won't break compatibility with other
    xslt processors and that will allow you even
    a greater deal of flexibility.
    </para>
  </sect>

  <sect>
    <title>Why rewriting the code?</title>

    <para>
    While working on mod-xslt2, I also wanted to have 
    a clean API which could be used on other web
    server then the ones I was working on, and wanted
    to have a flexible and expandable infrastructure
    to add many new features.
    </para>

    <para>
    Most of them are still under development but I feel
    like many of the targets I wanted to achieve 
    have now been reached. The API has already been
    used both from Apache 1.3 (stable) and Apache 2.0
    (I still need a bit of testing, since I'm one of
    those who don't trust Apache 2.0 yet and do not
    run it on their production systems).
    </para>

    <para>
    Hooks are also provided to easily implement result 
    cacheing and work is in progress to have a CGI and 
    Proxy parser.
    </para>

    <para>
    There are even many features that are under
    discussion right now that will be probably
    added day by day. Take a look to the future
    direction pages to know more about those features.
    </para>
  </sect>
</article>	

