ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sean Kelly" <ke...@ad1440.net>
Subject Re: Including other xml files in build.xml
Date Wed, 28 Feb 2001 21:36:48 GMT
> <?xml version="1.0"?>

Although not necessary, you ought to add the standalone
declaration:

  <?xml version="1.0" standalone="no"?>

> <!DOCTYPE web-app [

You should change "web-app" to "project", since that's
what your root element is:

  <!DOCTYPE project [

>     <!ENTITY common SYSTEM "..\common\cinfin_build.xml">

That looks OK, but I always use front slashes, even on
Windows systems, out of paranoia ... I'm afraid that
some subsystem will treat those as escaped characters.
And while we're being anal, toss the URL protocol name
in there, too:

   <!ENTITY common SYSTEM "file:../common/cinfin_build.xml">

>   %common;

There's an error.  You declared a general entity, not a
parameter entity.  Change that to:

    &common;

When I do all of the above, it works for me.  Here's my
build.xml file:

---
<?xml version="1.0" standalone="no"?>
<!DOCTYPE project [
<!ENTITY common SYSTEM "file:../common.xml">
]>
<project name="test" default="test" basedir=".">
  <target name="test">
    &common;
    <echo>Test 2.</echo>
  </target>
</project>
---

and here's the file common.xml in the parent directory:

---
<echo>Test 1.</echo>
---

And when Ant digests it, I get:

---
Test 1.
Test 2.
---

Good luck.
--k



Mime
View raw message