ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicola Ken Barozzi <nicola...@apache.org>
Subject Re: xml namespace support in ant2
Date Fri, 06 Sep 2002 09:57:54 GMT

Wannheden, Knut wrote:
>>>XML namespaces certainly wouldn't be a prerequisite for a 
>>
>>grammar, but it
>>
>>>would certainly make it easier.
>>>
>>>[1] Namespaces in XML http://www.w3.org/TR/REC-xml-names/
>>
>>Good, now I understand :-D
>>
>>You are right, if we make tasks use a namespace, they can also supply 
>>the schema for themselves, and be validated by XML parsing instead of 
>>inside themselves!
> 
> Maybe you could also bind a namespace to a library of tasks and types
> instead of to individual tasks.  Then you could use the library descriptor
> (as in antlib) to specify the schema (if one is available).

Yes, this is the idea, we agree :-)

>>This is really very very cool, I want it in embed proposal :-)
>>
>>Any practical implementative suggestions?
> 
> I suppose that's where it gets interesting and probably difficult at the
> same time.  Difficult because you can't just validate the whole buildfile
> because it's only stated in the buildfile itself what external libraries are
> used!  So either you would first have to assemble a schema for the whole
> document from the separate schema fragments, or you would have to validate
> the different tasks and types against the corresponding schema fragment
> individually.

Hmmm... IIRC when you parse an XML file, you can provide your own 
resolver to get external resources someway...

But maybe doing it separately for each namespace is easier...

Hmmm, we gotta look at the actual validators and how they operate.

> Other than that you still have to decide on a schema language to use.  I
> would argue that RELAX NG would be the most suitable for this kind of stuff.
> But I'm not an expert on this, so maybe someone will disagree.

For this, DTD is not usable, Schema is possible, but many agree that 
RELAX NG is the best... if only I knew what it is ;-)

> For Ant's elements, tasks, and types it shouldn't be too hard to put
> together a schema.  And I think that would already be of great value.  But
> having a reserved XML namespace for the Ant elements would almost be a
> requirement.

Yes, I think so.

> I have already written a couple of RELAX NG grammars for my own purposes,
> but they're by no means complete.

Send them in :-)

-- 
Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------


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