ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From (David M. Karr)
Subject Set EntityResolver for "style" so inc. files can be found easily?
Date Thu, 16 May 2002 00:48:50 GMT
I've been working on a process so I can actually use Tomcat's JspC output.
I've settled on using a XSLT stylesheet to combine the "web.xml" with the
servlet-mappings file generated by JspC.

The basic elements of this are:

 1. Original "web.xml" file.
 2. A "webinc.xml" fragment, generated by JspC.
 3. An "includeWrapper.xml", which includes "webinc.xml" by entity reference.
 4. The "webmerge.xsl" stylesheet.

After much wrangling (and wasted time spent on other strategies), this actually
works.  If I can clean up this last detail, I'll probably post my results, if
anyone is interested.

However, I have one minor nit with this.  From the root directory of my source
tree, I have a directory named "web-inf" where I store the various files
related to this, like the "web.xml", "includeWrapper.xml", etcetera.  I also
generate the "webinc.xml" file into this directory.  Note that I need an
"includeWrapper.xml" file, because the file generated by "JspC" is not
completely well-formed, as it doesn't have a root "web-app" element.

My problem is with what I needed to specify in the "includeWrapper.xml" file in
order for this to work:

<?xml version="1.0"?>
<!DOCTYPE web-app
  PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
[<!ENTITY webinc PUBLIC "webinc" "file:web-inf/webinc.xml">]

You notice that I had to hardcode the path to the "web-inf" directory, even
though both "includeWrapper.xml" and "webinc.xml" are IN that directory.  I run
the process from the parent directory of "web-inf", so you can sort of
understand why I had to do this.

This is the old issue of needing to have a smarter EntityResolver.  I'd like to
use an EntityResolver which I can specify lookup paths at RUN time, instead of
hardcoding the paths into the files.  It appears that the "style" task doesn't
allow setting a different EntityResolver, or even nicer, specifying the use of
a predefined EntityResolver that just takes a list of directories to check.

David M. Karr          ; Java/J2EE/XML/Unix/C++

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message