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

Jean Jordaan jean@upfrontsystems.co.za
Fri, 28 Feb 2003 14:41:50 +0200


Hi Chris

<thinking aloud>

> Suddenly I feel myself swimming over to Him's POV.
> This reminds me a lot of Script (Python)'s ability to remap things like 
> context and container to other names. 

Don't let that consideration sway you .. Look at this:

<?xml version="1.0"?>
<!DOCTYPE window>
<window
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
</window>

The 'html' namespace there is XHTML, not HTML3.2, and the default
is the XUL namespace .. someone could also say
xmlns:html="http://funky.org/nothtml", and in each case
<html:b>the meaning of the tag would be different</html:b>.
However, in each case the meaning is unambiguously identified by
the URI, and your parser would tell your in error messages and
logging what it was. If it mapped to XHTML or HTML3.2, a web
browser would be able to render it.

> After a coupla years experience, I'm not even sure the bindings tab is 
> necessary. Think of the complexity that could have been saved by leaving 
> it out...
> 
> Will this prefix mapping thing be the same?

It's not the same, because it conforms to a formal spec. You could
bind a Script's container to any Zope object, but you can only bind
a namespace to a URI that is always resolved in one way.
As Mike Brown says with reference to RFC 2396 in
http://lists.fourthought.com/pipermail/4suite/2003-February/005201.html
"They're not easy to [implement ...] But these rules are static
and well defined."

>> the usual solution is to use unenforced
>> conventions, like never mapping the "tal" prefix to something other 
>> than the TAL URI.  

Actually, as long as the namespace used for TAL in the documents
in question resolved to the TAL URI, it wouldn't matter if it were
mapped to something different. If you needed to integrate your
ZPT's with Three Acronymn Letter XML you might have to write ZPTs
where you use another namespace for ZPT TAL:

xmlns:zopetal="http://xml.zope.org/namespaces/tal"
xmlns:tal="http://other/entity/we.dont.control.but.need.to.parse"

And other people would still be able to reuse your templates, as
your templates define their own namespaces, that resolve to the
same common resources as those of the people using your templates.

Zope can have permanent default URI (-like things) for its common
namespaces.

</thinking aloud>

Shane, you'll yell when I'm misrepresenting your position, right?

-- 
Jean Jordaan
http://www.upfrontsystems.co.za