ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chen Becky" <>
Subject RE: Doubt in using ENTITY
Date Wed, 29 Oct 2003 22:33:41 GMT

Bob (Robert E. Newby),

Your code sample is helpful for me as well.
I have an extra requirement that I need to setup a property with
different value based on some conditions.

I wonder if I can have build-properties.xml looks like this:
		<property name="output-char" value="A"/>
		<property name="output-char" value="B"/>
		<property name="output-char" value="C"/>

But when I invoke "build-properties-file;" from build.xml, how can I
tell build-properties.xml to run only <a>, <b> or <c>?
I know this is more like XML question than ANT, any thoughts?

-----Original Message-----
From: Robert E. Newby [] 
Sent: Wednesday, October 29, 2003 11:15 AM
Subject: Re: Doubt in using ENTITY

vikramjit singh wrote:
> Hi,
> I am making a properties.xml file, which holds all the properties and 
> the corresponding path. I am including the properties.xml file in 
> build.xml like this below
> <!-- Define the target includes for all package types --> <!DOCTYPE 
> project [
>     <!ENTITY properties SYSTEM "file:./properties.xml">
> ]>
> <project name="CustomerProfile" default="dist" basedir=".">
>   &properties;
> ...
> </project>
> In my properties file, if i make the xml well formed i.e. enclose the 
> properties and path tags in a parent tag, then i get the following 
> error. The properties.xml file structure snippet is as below..
> <?xml version="1.0"?>
> <properties>
>     <property environment="env"/>
>     <property name="src" value="src"/>
> ...
> </properties>
> file:./properties.xml:1: more pseudo attributes is expected.
> But if i remove, <?xml version="1.0"?> and the <properties> tag and 
> dont enclose a parent tag, then all runs fine.
> Is this as it is to be done, or am i missing something.
> Regards,
> Vikram.


We do this all the time, with great results.  Here are some code

>From a representative build.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE project [
  <!ENTITY build-properties-file SYSTEM "file:build-properties.xml">
  <!ENTITY livespace-build-properties-file SYSTEM


<project name="Master com.viviport Building and Deployment"
default="usage" basedir="../..">

  <!-- PROPERTIES -->

  <!-- load standard build properties -->
  <property name="top" value="${basedir}/utilities"/>


In the referenced build-properties.xml file, both:

<?xml version="1.0" encoding="UTF-8"?>


  <!-- Set path to parent of all project trees -->
  <property name="" value="${top}/.."/>
  <property name="dir.utilities" value="${}/utilities"/>
  <property name="" value="${dir.utilities}/build"/>
  <property name="" value="${dir.utilities}/tools"/>
  <property name=""
  <property name=""


As you've discovered, since the &build-properties-file; performs textual
inclusion of the external entity's content, the external entity cannot
have a root xml element.

I hope this helps clear things up for you.


Robert E. Newby

Principal Software Engineer
Vestmark, Inc.
500 Edgewater Drive, Suite 564
Wakefield, Massachusetts 01880 USA
781-224-3646 | Bob _ Newby @ vestmark . com | www . vestmark . com

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

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

View raw message