ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Costin Manolache <cmanola...@yahoo.com>
Subject RE: xml namespace support in ant2
Date Wed, 02 Oct 2002 14:51:46 GMT
Wannheden, Knut wrote:

> Certainly there are different things one can validate in the usage of a
> task
> or type.  The validation you seem to be talking about is the actual values
> of the parameters.  And, no question about it, this is better validated by
> the task itself.  What I am more concerned about is the different
> combinations of attributes and nested elements (in XML lingua) which are
> allowed.  Take the "refid" attribute of types for example: If you specify
> the refid attribute, then no other attributes or child elements are
> allowed.

I think this is also a problem of parameter validation, and I prefer 
the code checking it ( so both beans and xml use will have the check ).
The task can also do a lot of things that are just not possible in
a schema - like give good messages, or deal with complex situations
or work around.

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 ).


> 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
> RELAX NG.

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.

As I said - we don't need to argue about this, if it comes to a vote
it can get a majority or not, my vote will be against and I'm unlikely
to change.
( on tomcat we did had a majority against doing schema validations )

>> But if a task has a descriptor, there is absolutely no reason to
>> require the use of taskdef ( unless the user wants to - for example
>> to change a task name, which should be strongly discouraged and
>> is no longer needed with ns ).
>> 
> 
> Yes, I agree.  But are descriptors loaded automatically by Ant?  I thought
> they were loaded by a <antlib> element.

As I said, you can load them automatically with taskdef ( just like today -
it just need an extension when the xml format is defined ). I'm ok
with defining a new 'antlib' task, but I don't think it's necesary
since taskdef already has a lot of the functionality.

I didn't say 'automatic only' - just that both ways should be possible.
I see no reason to require the user to duplicate information that
is already available.

 
> So you propose that all taskdefs take place completely automagically?  No
> <antlib> either?  IMHO it would feel more natural if there were a

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.

> 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.


-- 
Costin



--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message