ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Reilly" <>
Subject xinclude for ant?
Date Wed, 20 Jun 2007 21:43:13 GMT
I have just realized that xinclude can be enabled
easily using JAXPUtils:

Index: src/main/org/apache/tools/ant/util/
--- src/main/org/apache/tools/ant/util/   (revision 545653)
+++ src/main/org/apache/tools/ant/util/   (working copy)
@@ -103,6 +103,7 @@
         if (nsParserFactory == null) {
             nsParserFactory = newParserFactory();
+            nsParserFactory.setXIncludeAware(true);
         return nsParserFactory;

This allows one to do:
<project default="x"  xmlns:xi="">
  <target name="x">
    <xi:include href="a.xml"/>

where a.xml is:

I can see problems :- the inclusion is at the xml level and ant does
not know about the included file (ant does not get SAX events on about
the inclusion), so that any
errors in the included file will be reported at the includer line.
This means that it is not user friendly.

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

View raw message