ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jim.ful...@ruminate.co.uk
Subject Re: task namespaces
Date Mon, 12 Sep 2005 10:09:51 GMT
Steve Loughran <stevel@apache.org> wrote ..
> 
> 
> 
> I know separate namespace work is optional, but once you start on it it,
> it is more manageable. For this reason, the next edition of 
> java-dev-with-ant will use namespaces everywhere too, except for the 
> bits where I dont understand what is going on. Actually, I am slowly 
> building up model. Nested stuff is the troublespot
> 
> -declare task <mytask> in namespace n1:
> -declare type <mytest> extends Condition in namespace n1:
> 
> If mytask has a nested element <action>, and it also supports multiple
> nested conditions, is this how it looks
> 
> <n1:mytask>
> 	<action>this action is a direct element; default NS or local ns?</action>
> 	<http url="this-is-a-condition-from-Ant; default NS" />
>          <n1:mytest>this is my new test, in the new ns</n1:mytest>
> </n1:mytask>
> 
> What confuses me here is that the ns of a nested element (not a type, an
> element) is what? local? or Ant's main ns?

this is an old XML NS chestnut.

http://www.rpbourret.com/xml/NamespacesFAQ.htm

is the authoratative place to go to understand the permathreads.

specifically 

http://www.rpbourret.com/xml/NamespacesFAQ.htm#s6

discusses scope.

'An XML namespace declaration remains in scope for the element on which it is declared and
all of its descendants, unless it is overridden or undeclared on one of those descendants'

so <action/> and <http/> are in the n1: namespace.

hth, Jim Fuller
 


Mime
View raw message