ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <>
Subject Re: Adding magic properties for targets?
Date Mon, 02 Jun 2008 14:47:01 GMT
James Fuller wrote:

> wouldn't it be great if property names were qnames and then we could do
>   ant:default-target
>   ant:targets-invoked
> though I do not think the default namespace e.g.
> is wholly appropriate as it concerns
> itself with ant libraries.
> I know ant doesn't fully subscribe to all things xml ... but there
> maybe benefits to not reinventing things.

No, QNames are (a) evil (b) not part of XML; they ar part of the W3C XML 
  I've just noticed the that Open Grid Forum's Open Grid Services 
Architecture mailing list has just discovered that very fact only weeks 
before their WS-ResourceFramework Basic Profile 1.0 was about to be 
announced (I'm on some very obscure mailing lists)...I think I pointed 
that out to them years back.

Here's the basic problem, and it exists in XPath too: you cannot 
evaluate the prefix to namespace URI mapping without building and 
maintaining the entire context of namespace declarations. And you get a 
new error type -unknown prefix- that is not needed. That is, it would be 
better to pass around things like


Or even


than it would be to have

because you can only evaluate element within the context of the original 

Now imagine the <qname> task takes a property and sets it to the 
expanded string, and use it in a presetdef

<target xmlns:example=""/>
<presetdef name="eval">

and then I run it here

<target xmlns:example="http://somethingelse" >
    <eval property="evaluated" />

What gets expanded?

Or we run it here, where the namespace is entirely undefined:

<target >
    <eval property="evaluated" />

See? QNames are evil.

I had lunch with the W3C TAG last week, primarily to give them a hard 
time over releasing WS-Addressing without a single test case(*). I guess 
I should have raised QNames at the same time.


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

View raw message