From 18382ddec1cae5933ac87b791b68def1d998831c Mon Sep 17 00:00:00 2001 From: Conor MacNeill Date: Mon, 29 Jan 2001 01:19:59 +0000 Subject: [PATCH] Update to "Ant in Anger" regarding importing XML Submitted by: Steve Loughran git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@268528 13f79535-47bb-0310-9956-ffa450edef68 --- docs/ant_in_anger.html | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/docs/ant_in_anger.html b/docs/ant_in_anger.html index 640647f42..bd4363177 100644 --- a/docs/ant_in_anger.html +++ b/docs/ant_in_anger.html @@ -567,15 +567,38 @@ build.compiler to "jikes" for it to be used in your build files. #include targets to simplify multi build.xml projects
-You can import XML files into a build file using <?import?> -an element of XML syntax which the standard parsers use. This lets -a multi-project development program share code through reference, +You can import XML files into a build file using the XML parser itself. +This lets a multi-project development program share code through reference, rather than cut and paste re-use. It also lets one build up a file of standard tasks which can be reused over time. Because the import mechanism is at a level below which ant is aware, treat it as equivalent to the #include mechanism of the 'legacy' languages C and C++. +

+ +There are two inclusion mechanisms, an ugly one for all parsers and a +clean one. For now, the ugly +method is the most portable:- +

+	<!DOCTYPE project [
+	  <!ENTITY IncludeBuildCore SYSTEM "buildCore.xml">
+	  <!ENTITY IncludeBuildSecondary SYSTEM "buildSecondary.xml">
+	%IncludeBuildCore;
+	%IncludeBuildSecondary;
+	]>  
+	
+	<target name="includedBuild">
+		&IncludeBuildCore;
+		&IncludeBuildSecondary;
+	</target>
+
+The clean method using XInclude/Xpath will let you include named +targets from one build file or another, using + +the xpointer syntax. You'll need to wait for the W3C proposals +to finalise and the java XML parsers to implement it before +using xpointer references.
Implement complex Ant builds through XSL