ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "vikramjit singh" <>
Subject RE: Doubt in using ENTITY
Date Wed, 30 Oct 2002 04:47:49 GMT
Hi Robert,

Thanks for the explanation, and things are lot more clear, and it is logical
too. Why this question came up, coz i am using my build files in JBuilder
8.0, and if the xml files are not proper, then JBuilder shows an error and
the build file does not run from JBuilder.
>From an earlier post, i was suggested to use Ant 1.6 beta, which has
<import> tags. I just downloaded that, and am gonna use the <import> tag.


-----Original Message-----
From: news []On Behalf Of Robert E. Newby
Sent: Wednesday, October 29, 2003 9:45 PM
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