ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wannheden, Knut" <knut.wannhe...@paranor.ch>
Subject RE: Antlib... when?
Date Mon, 06 Jan 2003 09:11:55 GMT
Just a few comments...

> From: Costin Manolache [mailto:cmanolache@yahoo.com]
> 
> I think we should agree on some basic issues:
> 
> 1. If a namespace will be used to resolve conflicts - it will be XML 
> namespace ( i.e. we won't invent our own ).
> 
> 2. Existing files will not have to change. ( i.e. the default 
> namespace
> will be used for the core tasks ).
> 

Wouldn't it be a good idea to introduce a namespace for the core tasks and
make the default namespace deprecated.  Old buildfiles would still be valid,
but the preferred syntax would be with an Ant core namespace.  Maybe like
this:

<project xmlns="antlib:org.apache.ant.core">
 <.../>
</project>

The only difference would be that <project/> would declare the default
namespace.

A question:  How should namespaces and nested elements be handled?  Let's
say I write my own antlib (package com.foo) with a task <bar/>.  Then my
buildfile would contain something like:
    <antlib name="com.foo"/>
    <foo:bar xmlns:foo="antlib:com.foo"/>

If I now want to extend the task to use nested elements, in what namespace
would they be and how would this affect the setXXX() interface of the task?
I suppose the options are to use the default namespace or the same namespace
as the task.  So either:

    <foo:bar xmlns:foo="antlib:com.foo">
      <baz/>
    </foo:bar>

or:

    <foo:bar xmlns:foo="antlib:com.foo">
      <foo:baz/>
    </foo:bar>

I suppose the second choice would be nice to have because then it would be
quite clear what is meant by a nested <fileset/> element (which is declared
in the core antlib).

--
knut

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message