ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peter reilly <peter.rei...@corvil.com>
Subject Re: antlib / proposal of Peter Reilly
Date Mon, 19 May 2003 12:55:39 GMT
On Monday 19 May 2003 11:50, Wannheden, Knut wrote:
> Peter,
>
> > >   <acme:hellp xmlns:acme="NSURI" >
> > >
> > > This would allow arbitrary NSURIs ( for people who like
> >
> > meaning-free URIs)
> >
> > > and allow the classpath association.
> >
> > I do not want meaning-free URIs.
> > I want ant to ignore URIs that it does not understand.
> > At the time of processing the typedef's uri, the parsing has
> > been complete, so
> > my rule is that uri's used in <typedef/> have to start with "antlib:".
>
> I don't quite see why it would be impossible to have meaning-free URIs. 

Nothing is impossible..., but it is difficult to have meaning-free URIs and to
support (as in ignore) other URIs.

I would like ant to ignore other namespaces so that it is a civilized member
of the xml community.

For example the following specifies which processor deals with which
element tag:

<project xmlns:h="http://www.w3.org/1999/xhtml"
         xmlns="ant:core">
  <echo message="hello world"/>
  <h:html>
    <h:body>hello world</h:body>
  </h:html>
</project>

the above produces "hello world" as an ant script and "hello world" in an NS
aware browser.

> I
> think it makes perfectly sense.  Namespaces are to avoid name clashes.

This is not the only reason for XML namespaces. The standard says
that are to allow "elements and attributes that are defined for and used
by multiple software modules".

>  Ant
> doesn't either force you to use certain Java package names when
> implementing tasks.
>
> Can't the <typedef/> task just add another antlib to the Project?

? this is what <typedef/> does

>
> > <typedef classpath="cp" resource=".." uri="antlib:arbitarystring"/>
> >    where "arbiratystring" is an arbitary string, but the
> > package from is
> >    treated specially with first encountered.
>
> I think an URI like antlib:arbitarystring is quite confusing as well.

I would agree with you here. Maybe another pattern could be allowed?
I only have a problem with an arbitrary uri ;-)

>  IMO
> an URI starting with "antlib:" should always mean that the following
> denotes a package with that antlib.  What would happen if I had a Java
> package on the classpath called "arbitarystring"?

The definitions are appended to the definitions defined in {converted
  package}/antlib.xml.

This is the same behaviour as definitions going into the default namespace.

Peter

Mime
View raw message