[Zope3-dev] Re: Better access to APIs in paths

Jim Fulton jim@ZOPE.COM
Fri, 28 Feb 2003 15:29:07 -0500


Steve Alexander wrote:
> Fred L. Drake, Jr. wrote:
> 
>> Tres Seaver writes:
>>  > Maybe I'm just being dense, but can't we solve the "default 
>> namespaces"
>>  > issue by defining the defaults in the 'main_template', in which 
>> *every*
>>  > "normal" Zope page template will wrap itself?  Then people who want to
>>  > re-bind the defaults, or add new ones, will just customize that 
>> template
>>  > (or the macro which defines the namespaces :).
>>
>> No, not quite.  The namespace declarations need to be present in each
>> document that references them; each of them is parsed separately.  The
>> fact that we're generating one document from several (the page sent to
>> the user from a pile of templates) doesn't change the fact that
>> parsing of the sources are separate.
> 
> 
> Is there any way to make metal:fill-slot imply that the tal:namespaces 
> declared in the macro should apply when the template that fills the slot 
> is rendered?

But that would defeat the purpose of making namespaces "explicit".
The namespace declarations are indicating how source like "foo:" should
be interpreted. If we move this out of the source, we might as well move it out
of zpt altogether.

Jim

-- 
Jim Fulton           mailto:jim@zope.com       Python Powered!
CTO                  (888) 344-4332            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org