Better access to APIs in paths (was Re: [Zope3-dev] needing viewsclues
- template/title troubles)
Shane Hathaway
shane@zope.com
Mon, 24 Feb 2003 15:14:02 -0500
Stuart Bishop wrote:
>
> On Tuesday, February 25, 2003, at 02:13 AM, Shane Hathaway wrote:
>
>> I also want to clarify that in this syntax, you're not allowed to use
>> a namespace qualifier for the first name in the path. The first name
>> must be a local or global variable (just like today). So
>> "dc:context/title" is not allowed, but something like
>> "context/zope:services/events/dc:title" is allowed and probably > common.
>
>
> I originally started with "context/dc:title", but added more magic by
> making the namespaces map to a ZPT expression type (so it could be
> done). But this is probably silly since you then have to make sure so
> twonk tries to to map XPATH to the 'path' prefix... Although
> tal:content="dc:title" looks nicer... so I'm confused.
It's not explicit enough. You could mean context/dc:title,
container/dc:title, template/dc:title, etc.
> One issue I just thought of - how does this map to METAL? If we allow
> the 'namespace prefixes' to be changed
> in the TAL, this could change the interpretation of the macro so that
> instead of the Dublin Core title being
> rendered, some other bit of metadata called title is. Is this a feature?
No, and now I realize why I envisioned the implementation differently
from Evan. I don't think of "dc" as a variable name, I think of it as a
namespace abbreviation. "dc" would be expanded to a namespace when the
template is compiled. So you'd always get the Dublin Core title.
Shane