For those folks who like the idea of using a common stylesheet for
generating documentation and web sites from XML input documents across
multiple Jakarrta projects, but don't necessarily want to be tied to
Anakia, you now have a choice.  I've added an XSLT stylesheet
(xdocs/stylesheets/site.xsl) that is pretty close to functional
equivalence with the "site.vsl" macros used by Anakia.  Remaining TODOs
are listed at the top of the file to finish up, but you can run "ant xslt"
in jakarta-site2 and examine the generated pages to see how close it
already is.  The last few things are relatively minor.

Both approaches can read the same XML input documents, because they use
the same sets of elements to render the same kind of HTML.  The only
important difference when you set things up in Ant relates to the
generation of relative URLs.

* Anakia is typically invoked with an includes attribute like
  "**/*.xml", to recursively process an entire tree of XML sources.
  The Anakia processor creates a "relativePath" variable reflecting
  the location of the current source file in the directory hierarchy,
  so that things like the navigation menu links are calculated
  appropriately.

* To use XSLT, the simplest solution I found was to generate each
  directory's worth of HTML in a separate invocation of the <style>
  tag, and pass a parameter to the XSLT stylesheet telling it what
  the appropriate relative path prefix is.  The jakarta-site2 build.xml
  file illustrates this approach to building the Jakarta web site,
  which has two directory levels (top-level and the "site"
  subdirectory).  There might be some more elegant way to approach
  this, but hey ... it works.

Please help me debug this stylesheet, and improve its compatibility with
site.vsl, by checking out the jakarta-site2 module and running the
"xslt" target.  NOTE:  you will need to make sure that your Ant install
includes the appropriate optional.jar file, and has access to either
JAXP/1.1 (crimson.jar, jaxp.jar, and xalan.jar) or Xerces+Xalan.

Craig McClanahan




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to