ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 47155] New: Problem with less and greater tags and replace task
Date Tue, 05 May 2009 14:49:55 GMT

           Summary: Problem with less and greater tags and replace task
           Product: Ant
           Version: 1.7.1
          Platform: All
        OS/Version: Windows XP
            Status: NEW
          Severity: major
          Priority: P2
         Component: Core tasks

I'm trying to use ant to replace some values in XML file.
So I need to specify tags >, < in replacetoken.
It's behavior not good.

1. Code 
        <replace dir="${my.dir}">
            <include name="${what}.xml"/>
Produces this in xml:
Instead of real property value;

2. Code 
        <replace dir="${my.dir}" >
            <include name="${what}.xml"/>
Produces the same in xml:
Instead of real property value;

3. A little trick here, make invalid token and replace value like this:
        <replace dir="${hn.dir}" >
            <include name="${what}.xml"/>
Produces the wanted result:
<name>Replaced here with property Value</name>

If you didn't see the difference - it's additional ">" before closing tags
replacetoken and replacevalue.

I see here two bugs:
1. The correct (well-formed) token didn't parsed for properties if there are
tags (and in XML files thea are)
2. The incorrect token, which isn't in file however parsed (!) for properties,
then trailing symbols are dropped, and all replaced as needed.

That's not very well behaviour, I had to find this bug to replace something in
XML files :)

Configure bugmail:
------- You are receiving this mail because: -------
You are the assignee for the bug.

View raw message