ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Cepek" <>
Subject RE: wrapping long string literals
Date Wed, 17 Jul 2002 15:15:09 GMT
OK, I think I came across a solution for my own problem.

But I'm wondering if Ant developers would confirm a few things about my
"solution" (see questions at the end).

Solution:  use open quotes across lines, since newlines and tabs seem to
be translated into spaces, and spaces are accepted as filename
separators just as commas are.

For example, the "problem" from my original post could be written like
this (thanks Dominique for pointing me in this direction):

   <javadoc doctitle="SMSI Java API Reference" header="
           <header>&amp;copy; Copyright SMSI, 2000,
           2001, 2002&lt;br>All Rights Reserved</header>"
           ... />

This works perfectly, but only because HTML coalesces multiple spaces
into a single one for normal text (otherwise there would be lots of
spaces between 2000 and 2001).  The whitespace for indentation for the
header lines goes into the html (tabs and newlines seem to be translated
to spaces).  So for *literal* HTML or other plain-text uses, one would
need to abandon indentation in the Ant script.  But otherwise it seems
like it would work.

Another use we have found for this is with includes and excludes:

    <fileset dir="prog/dbloader/config" includes="
            SMSIMap.dtd SMSIMap.xml

In this example I demonstrate how newlines, spaces and/or commas all
seem to work fine to break a string literal for fileset filenames.

I have also tested this with the description element of the project
task, which also can be long.

So I'm left with these questions for the Ant developers:

0) can I count on this behavior consistently throughout Ant?

1) did I just miss all this wonderfulness in the documentation?


-----Original Message-----
From: Mike Cepek []
Sent: Friday, May 24, 2002 9:48 AM
To: Ant Users List
Subject: RE: wrapping long string literals

<<< some removed >>>

What I've learned so far is that XML doesn't offer this (being, by
definition, "unreadable" :-), and that other than extending ant (e.g.
property/append as proposed by Diane Holt), there isn't a clean,
universal solution.

Oh well.  I appreciate everyone's input!

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

View raw message