You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Michael Bauroth <mi...@falcom.de> on 2006/09/12 10:10:14 UTC

Replace problem

Hi,

I'm having a little problem with the replace task. Here is the code snippet:

<replace file="language.xml" token="@ENCODING" value="<?xml 
version="1.0" encoding="ISO-8859-1" ?>" />

The use of wrapping CDATA doesn't work too.

Have you eventually any suggestions?

Thanx in advance.

Regards
Michael

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Replace problem

Posted by Keith Hall <ke...@granada-learning.com>.
Have you tried
<replace file="language.xml" token="@ENCODING" value="&lt;?xml
version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot; ?&gt;" />

Michael Bauroth wrote:
> Hi MAT,
>
> unfortunately the issue is another one (using Eclipse):
>
> <quote>
> The value of attribute "value" associated with an element type
> "replace" must not contain the '<' character.
> </quote>
>
> Regards
> Michael
>
> Mathieu Champlon schrieb:
>> Michael Bauroth a écrit :
>>> Hi,
>>>
>>> I'm having a little problem with the replace task. Here is the code
>>> snippet:
>>>
>>> <replace file="language.xml" token="@ENCODING" value="<?xml
>>> version="1.0" encoding="ISO-8859-1" ?>" />
>>>
>>> The use of wrapping CDATA doesn't work too.
>>>
>>> Have you eventually any suggestions?
>> Hello,
>>
>> If I understand the issue correctly :
>> <replace file="language.xml" token="@ENCODING" value='<?xml
>> version="1.0" encoding="ISO-8859-1" ?>' />
>> or
>> <replace file="language.xml" token="@ENCODING" value="<?xml
>> version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot; ?>" />
>>
>>
>> MAT.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Replace problem

Posted by Michael Bauroth <mi...@falcom.de>.
No, & isn't allowed too :(

I've found another solution(!) at all :)

In the build script itself I use an import of an external property file:

<property file="./build/build-tracker.props" />

The property file contains:

encoding = <?xml version="1.0" encoding="ISO-8859-1" ?>

The replace task in the build script looks like this:

<replace file="language.xml" token="@ENCODING@" value='${encoding}' />

Regards
Michael




Mathieu Champlon schrieb:
> Michael Bauroth a écrit :
>> Hi MAT,
>>
>> unfortunately the issue is another one (using Eclipse):
>>
>> <quote>
>> The value of attribute "value" associated with an element type 
>> "replace" must not contain the '<' character.
>> </quote>
> What about :
> <replace file="language.xml" token="@ENCODING" value='&lt;?xml 
> version="1.0" encoding="ISO-8859-1" ?&gt;'/>
> 
> The &gt; is probably not required but it surely does not harm...
> 
> MAT.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Replace problem

Posted by Mathieu Champlon <m....@free.fr>.
Michael Bauroth a écrit :
> Hi MAT,
>
> unfortunately the issue is another one (using Eclipse):
>
> <quote>
> The value of attribute "value" associated with an element type 
> "replace" must not contain the '<' character.
> </quote>
What about :
<replace file="language.xml" token="@ENCODING" value='&lt;?xml 
version="1.0" encoding="ISO-8859-1" ?&gt;'/>

The &gt; is probably not required but it surely does not harm...

MAT.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Replace problem

Posted by Michael Bauroth <mi...@falcom.de>.
Hi MAT,

unfortunately the issue is another one (using Eclipse):

<quote>
The value of attribute "value" associated with an element type "replace" 
must not contain the '<' character.
</quote>

Regards
Michael

Mathieu Champlon schrieb:
> Michael Bauroth a écrit :
>> Hi,
>>
>> I'm having a little problem with the replace task. Here is the code 
>> snippet:
>>
>> <replace file="language.xml" token="@ENCODING" value="<?xml 
>> version="1.0" encoding="ISO-8859-1" ?>" />
>>
>> The use of wrapping CDATA doesn't work too.
>>
>> Have you eventually any suggestions?
> Hello,
> 
> If I understand the issue correctly :
> <replace file="language.xml" token="@ENCODING" value='<?xml 
> version="1.0" encoding="ISO-8859-1" ?>' />
> or
> <replace file="language.xml" token="@ENCODING" value="<?xml 
> version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot; ?>" />
> 
> 
> MAT.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Replace problem

Posted by Mathieu Champlon <m....@free.fr>.
Michael Bauroth a écrit :
> Hi,
>
> I'm having a little problem with the replace task. Here is the code 
> snippet:
>
> <replace file="language.xml" token="@ENCODING" value="<?xml 
> version="1.0" encoding="ISO-8859-1" ?>" />
>
> The use of wrapping CDATA doesn't work too.
>
> Have you eventually any suggestions?
Hello,

If I understand the issue correctly :
<replace file="language.xml" token="@ENCODING" value='<?xml 
version="1.0" encoding="ISO-8859-1" ?>' />
or
<replace file="language.xml" token="@ENCODING" value="<?xml 
version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot; ?>" />


MAT.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org