Grokbase Groups Ant user June 2009
FAQ

[Ant-user] <isset> oddity

Gilbert Rebhan
Jun 17, 2009 at 8:44 pm

Stefan Bodewig schrieb:
On 2009-06-17, Rebhan, Gilbert wrote:

It wasn't an issue with jdk, but the processNode Method in XmlProperty
if (nodeText.trim().length() != 0 || emptyNode) {
addProperty(prefix, nodeText, id);
}
when trim removes all white spaces, so it works with
if (nodeText.trim().length() >= 0 || emptyNode) {
addProperty(prefix, nodeText, id);
}
Works with ant 1.7.1, jdk 1.5.0_11 and jdk 1.6.0_07 on Windows 2000
Have to recheck on my machine later ..
I guess this is for convenience so that

<foo></foo>

and

<foo/>

mean the same thing as

<foo>
</foo>

(it's not that likely that people actually want a value of newline).

Maybe we need some sort of flag?

hmm, i just checked on my private machine - OpenSUSE 11.1/64bit
with jdk 1.5.0_18 and jdk 1.6.0_13 and the same propertyfiles,
means <xmlkey> <xmlkey/> and txtkey=*blank*
but the patch has no impact, still the same output !?

Using a " " property may not be of practical importance, but the
behaviour should be the same for txtproperty and xmlproperty,
it is, but diametrical =

on my LinuxBox (jdk 5 +6, the same behavior already with ant 1.6.5)
[echo] ${xmlkey} == ${xmlkey}
[echo] ${txtkey} == ${txtkey}
[echo] xmlkey not set
[echo] txtkey not set

and on Windows and AIX (jdk 5 + 6)
[echo] ${xmlkey} ==
[echo] ${txtkey} ==
[echo] xmlkey set
[echo] txtkey set

maybe a 32bit <> 64bit issue ?
Right now i have no 32bit Linux around to check ..

Can someone confirm my investigations ?


Regards, Gilbert






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

Search Discussions

Discussion Posts

Previous

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 7 of 7 | next ›