cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David J. Manura" <d...@Lehigh.EDU>
Subject Re: Cocoon
Date Thu, 14 Sep 2000 17:07:41 GMT
> Hi All,
>
> Are there any other utilities like Cocoon which can act as viable
> alternatives to Cocoon ?
>
> Are there any tools which can interpret XSP and XML ?
>
> Regards,
> Swapnil

I'm creating one!  For a few of my own web sites, I'm developing some
command-line utilities that use Apache Xalan to do XSL transformations on a
series of XML files to generate static HTML files.  The XML files have
special tags in them (under an "exml" ("extended XML") namespace) that
extend the capabilities of XML, such as tags for importing other resources
as XML and including it in the XML before doing the XSL processing.

The process is as follows:

1. for each file in a directory or subdirectory with a given extension, do
the following processing:
  1.1. Use SAX to read in the XML file and process any EXML processing tags.
  1.2. Use Xalan to transform the processed XML to HTML via XSL.

All files in a given compilation use the same XSL file.  That is, the XSL
file is specified on the command line, and not (as Cocoon does) in the XML
file.

A typical use case: (a math web site)

- All source XML files have the extension .mtp
- Each .mtp file models the content of a "webpage".  It contains text in
multiple languages.  It contains formulas written in a source language
called "WebTeX".
- The .mtp files can contain EXML tags to import other resources as XML.
"other resources" may include directory structures, XML, EXML, HTML
(included via CDATA tags), and (not currently implemented) SQL.
- There is a XSL file called page.xsl.
   - the XSL uses the Xalan Java extension mechanism to generate PNG image
files from the WebTeX formulas and reference them in the HTML file.

All pages in a directory tree are generated with the following command:
    makepage -xsl=page.xsl -language=spanish -src=.mtp -dest=.html .

   This tells it to compile all .mtp pages with the page.xsl stylesheet,
passing the "language=spanish" parameter to the stylesheet (.mtp contains
text in multiple languages) and produces .html files.

I have also considered adding another step, which is intermingling XSL into
the EXML files.  Therefore, given an XML source file,
  (1) the XSL will be applied.  This does not add presentation.  It merely
uses the features of XSL to do a logic transformation.  If it did expand the
capabilities of this utility to generate pages dynamically via a servlet,
then the GET/POS parameters would be passed as XSL parameters in this step.
  (2) The EXML processing occurs.

If I did expand this utility so that it could process pages dynamically,
then a the URL would appear like
  www.math2.org/test123/pageA.xml?stylesheet=page.xsl&language=spanish


Question: Can Cocoon generate pages statically?  Not many web sites
currently have support for Servlets/Cocoon, and it is also a problem if one
wants to distribute a web site via some other medium (like a CD).  Some of
the reasons I'm developing my own tools:
  - reduced overhead of static pages
  - not all my web sites have servlet support.
  - I had concerns about the content being coupled with the presentation
(such as where the XSL file is referred to in the XML files (although I
heard this is fixed in verison 2.0)).  I might not of been using it right,
but I don't know if the Cocoon model fit what I wanted to do.  Is there is a
better way to do what I want in Coocon (static compilation according to the
use-case above)?  If so, then maybe I should abandon my development efforts.

BTW, my code is much in development.  Though the prototype works, it needs
to be cleaned up/enhanced a lot (i.e. don't ask for a copy yet).

David Manura
sismspec@ix.netcom.com
Math2.org (Dave's Math Tables)
www.math2.org/math


> Hi All,
>
> Are there any other utilities like Cocoon which can act as viable
> alternatives to Cocoon ?
>
> Are there any tools which can interpret XSP and XML ?
>
> Regards,
> Swapnil



Mime
View raw message