Ben Godfrey wrote:

> This is the icing on the scripting cake that makes it a much
> nicer solution than my current one.

Yup, Ant is pretty good. One thing to watch out for is its XML DTD is a bit 
different than XSL. For example, <property
name="zoom" value="howdy"/> vs <xsl:variable name="zoom" select="'howdy'"/> and 
to use a variable in Ant ${zoom} vs in
Xalan {$zoom}.

> The addition of Ant would give the user more flexibilty in
> managing the output file structure, i.e. they could have groups
> of images copied to multiple locations etc.

I use a technique for creating multiple output documents. I just use a 
stylesheet to create the Ant file with a style
task for each output document. BTW, Ant can reuse a stylesheet for transforming 
a set of input docs.

> Does Ant package Xalan internally? Presumably I would have to
> build a custom Jar with Ant, Xalan and Xerces in?

Ant comes packaged with Crimson. Just copy xalan.jar, xercesImpl.jar and 
xml-api.jar into the Ant lib directory to use
Xalan instead.

> One thing that I'm not sure about is that I want to allow a
> fairly flexible system for locating page content blocks. My DTD
> defines a map section which describes the structure, naming
> pages and files and a content section which contains the
> definitions for page content. Because pages could get quite big
> I would like to be able to allow users to put some content
> blocks in with the map file but farm some content out to
> separate files, probably named with a src attrib.

I'm not sure I understand your problem completely. It sounds a bit like a 
rudimentary Content Management System, you
think? Something similar I do in a Xalan/Ant based web publishing system is 
with the site map. The site map is in XML
and one part of the stylesheet transforms it to HTML. But here's where the fun 
starts. In  this XML site map, the tags
have additional info, such as whether the page is static or dynamic, its source 
document(s), and which stylesheet will
render it to HTML or ASP or JSP. This XML site map is transformed by another 
stylesheet to create an Ant buildfile for
building the whole site. So the site map is the real backbone of the web site 
because it also defines how to build the
web site. hth

> I had a quick look at the Ant docs but I'm not sure how much
> support for XPath expressions it has.

None AFAIK. I think you'll want to do that in Xalan or with Xalan extensions. 
Think of Ant as a scripting tool like
nmake, but with an XML file format and running on a JVM.

Reply via email to