ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <ste...@apache.org>
Subject Re: String -> Ressource (was Re: archivefileset resources)
Date Fri, 23 Mar 2007 14:43:42 GMT
Stefan Bodewig wrote:
> On Wed, 21 Mar 2007, Matt Benson <gudnabrsam@yahoo.com> wrote:
> 
>> I think what is needed is a well-known syntax specification for
>> specifying a string representation of [resource-type][String to pass
>> to constructor] e.g. "file?/foo/bar.baz",
>> "url?http://www.apache.org", "string?blah blah blah".
> 
> This is so I can say
> 
> <unzip
>   src="url?http://www.apache.org/dist/ant/.../ant-bin-current.zip"/>
> 
> instead of
> 
> <unzip>
>   <url url="http://www.apache.org/dist/ant/.../ant-bin-current.zip"/>
> </unzip>
> 
> right?
> 
> Sounds right.


> 
>> This is to all intents and purposes the only way, IMHO, to seriously
>> take advantage in Ant tasks of our early decision to design
>> getOutputStream() into the Resource contract.  You'll notice my use
>> of the "?" character above to indicate the preceding text was the
>> name of a currently available type.  I used "?" because for xmlns as
>> well as fs reasons I'm pretty sure this character should NOT be a
>> colon.
> 
> I agree that a colon would be a bad choice, at least if we allow file
> ressources to be specified without a prefix.  I don't really see any
> conflict with xmlns.

ah, this is starting to scare me.

  you'd need qname resolution in string to support custom resources

<unzip
    src="tns:url?http://www.apache.org/dist/ant/.../ant-bin-current.zip"/>

  I hate those because they only resolve relative to where they are defined

<property name="url" 
value="tns:url?http://www.apache.org/dist/ant/.../ant-bin-current.zip"
  xmlns:tns="http://example.org" />

this defines the url property with the tns namespace in scope

but where it is used, it may be absent

<unzip
    src="${url}">

or defined to something else

<unzip
    src="${url}" xmlns:tns="http://something-else"/>

So you're going to have to retaiin the entire list of in-scope XMLNS 
declarations in every property you define. Now, what if its a custom 
task that creates the string?  is Project.setNewProperty() going to have 
to take a reference to the node in the DOM graph where the current task 
is working?


You may think I'm being a troublemaker here, but I have had to deal with 
exactly this kind of problem in the past, where we really did have to 
extract and maintain the xmlns list. And believe me, Xom does not go out 
of its way to make that easy

> 
>> However I'm not sure what the RIGHT "trigger character" is and IMO
>> this is the only outstanding question stopping us from adding this
>> feature to Ant.

that and how to correctly handle xml namespaces.

-steve


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


Mime
View raw message