ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erik Hatcher" <>
Subject Re: Set EntityResolver for "style" so inc. files can be found easily?
Date Thu, 16 May 2002 01:15:15 GMT
Two quick comments:

1) Check Ant 1.5's <xmlcatalog> datatype that <xmlvalidate> and
<xslt>/<style> support.  It allows for smarter entity resolution.

2) Consider XDoclet usage in your web.xml generation.  It has capabilities
to merge in static servlet mappings with its generated list from @tags.  Not
sure how that would jive with what you're doing, but something I thought was
worth mentioning.


----- Original Message -----
From: "David M. Karr" <>
To: <>
Sent: Wednesday, May 15, 2002 8:48 PM
Subject: Set EntityResolver for "style" so inc. files can be found easily?

> 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
>  4. The "webmerge.xsl" stylesheet.
> After much wrangling (and wasted time spent on other strategies), this
> works.  If I can clean up this last detail, I'll probably post my results,
> anyone is interested.
> However, I have one minor nit with this.  From the root directory of my
> 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
> 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">]
> >
> <web-app>
>  &webinc;
> </web-app>
> --------------------
> You notice that I had to hardcode the path to the "web-inf" directory,
> 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
> allow setting a different EntityResolver, or even nicer, specifying the
use of
> a predefined EntityResolver that just takes a list of directories to
> --
> ===================================================================
> David M. Karr          ; Java/J2EE/XML/Unix/C++
> --
> To unsubscribe, e-mail:   <>
> For additional commands, e-mail: <>

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

View raw message