ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wannheden, Knut" <>
Subject RE: xml namespace support in ant2
Date Thu, 03 Oct 2002 08:01:03 GMT

> -----Original Message-----
> From: Costin Manolache []
> Sent: Mittwoch, 2. Oktober 2002 16:52
> To:
> Subject: RE: xml namespace support in ant2
> Wannheden, Knut wrote:
> I'm very interested in 'embeding' ant in applications, with no xml
> involved - and I really don't like requiring an XML file to check the
> parameters ( including child objects ).

I agree with you, having the ability to embed Ant tasks in applications is
very useful indeed.  And here an XML grammar is quite useless.  Nevertheless
I think there should be a grammar of some kind, which could be used for
validation, documentation, and possibly other stuff.  The question is just
how to get there...

Maybe the introduction of XML namespaces will have another effect on the Ant
task bean approach.  Almost inevitably users will want to use XML namespaces
for attributes aswell.  Maybe just to reuse attributes from other XML
applications (like the href attribute from XLink) and maybe to define
general Ant task attributes (like verbose or failonerror) in the Ant
namespace.  The setXXX() way would fall short of this.  But that's a later
problem I guess.

> > Can you show me an example of how to (lexically) validate a 
> <fileset>
> > instance?  I think you'll have a a hard time doing it 
> simpler than with
> I'm not interested in 'lexical' validation of the XML file. AFAIK
> you can't use Relax or XML schema on beans, so it won't help me.

Although I wrote <fileset> I didn't mean the XML <fileset> but the abstract
notion of fileset, which is valid whether you talk about the XML syntax or
the bean interface.  Even when used as a bean, a task must be used in
certain ways.

But it's probably not worth discussing this problem any more, anyway.  If a
grammar should exist at all, it would have to be more specific for Ant and
should be used whether a task is used as a bean or driven by an XML snippet.
And as you say, RELAX NG is not good enough for this.  Although it can be
useful for other purposes, such as an buildfile authoring aid in RELAX NG
enabled XML editors.

> No. I propose that both discovery and explicit should be used.
> And I prefer adding an attribute to taskdef ( or allowing xml 
> in addition
> to the current properties file ), but if people want a new 
> name - it can
> be antlib as well.

The purpose of an <antlib> task would merely be to load a whole library of
tasks and types.  But sure, <taskdef> and <typedef> can be used for this,

> > I don't see too much of a gain in requiring that the 
> namespace URI be a
> > URL. I think if the specification says any URI should be 
> allowed (in the
> > newest draft it's even IRIs) then I think it would be 
> confusing if Ant
> > would restrict it to URLs.
> Again - I din't say 'require' ( that namespace be a URL ), 
> but 'allow'. 
> And if it is - use the information within. If it isn't - we'll need 
> a redirection mechansim ( CATALOG like ) - so that user knows where to
> go to get the tasks.

Or you can have a task catalog as HTML on the internet, where task writers
can register their namespace URIs and tasks.  A user which doesn't have a
task will have to look it up manually on the Internet.  But there are many
other details, and that's probably not worth discussing either.



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