conor 01/01/28 17:19:59
Modified: docs ant_in_anger.html Log: Update to "Ant in Anger" regarding importing XML Submitted by: Steve Loughran <[EMAIL PROTECTED]> Revision Changes Path 1.2 +26 -3 jakarta-ant/docs/ant_in_anger.html Index: ant_in_anger.html =================================================================== RCS file: /home/cvs/jakarta-ant/docs/ant_in_anger.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ant_in_anger.html 2001/01/11 11:56:34 1.1 +++ ant_in_anger.html 2001/01/29 01:19:59 1.2 @@ -567,15 +567,38 @@ #include targets to simplify multi build.xml projects </b><dd> -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++. +<p> + +There are two inclusion mechanisms, an ugly one for all parsers and a +clean one. For now, the ugly +method is the most portable:- +<pre> + <!DOCTYPE project [ + <!ENTITY IncludeBuildCore SYSTEM "buildCore.xml"> + <!ENTITY IncludeBuildSecondary SYSTEM "buildSecondary.xml"> + %IncludeBuildCore; + %IncludeBuildSecondary; + ]> + + <target name="includedBuild"> + &IncludeBuildCore; + &IncludeBuildSecondary; + </target> +</pre> +The clean method using XInclude/Xpath will let you include named +targets from one build file or another, using +<a href="http://www.w3.org/XML/Linking"> +the xpointer syntax</a>. You'll need to wait for the W3C proposals +to finalise and the java XML parsers to implement it before +using xpointer references. <dt><b> Implement complex Ant builds through XSL </b><dd>
