[Zope3-dev] KeyError when accessing ZopeTop

Marius Gedminas mgedmin@codeworks.lt
Mon, 7 Apr 2003 10:54:59 +0300


On Mon, Apr 07, 2003 at 10:46:46AM +0300, Marius Gedminas wrote:
> On Sat, Apr 05, 2003 at 07:48:06PM -0600, Garrett Smith wrote:
> > Here's what's causing the problem on my systems:
> > 
> >   .../skins/zopetop/www/widget_macros.pt
> >   --------------------------------------------------------
> >   ---> <?xml version="1.0" encoding="iso-8859-1"?>
> > 
> > When I remove this line, no more error. It's not the "encoding"
> > attribute...I removed that and still problems. I'm surprised that no one
> > is seeing this. I can recreate it on Windows and Linux.
> > 
> > I confirmed that the macros attribute of the page index was empty,
> > suggesting that the page just isn't loading. I didn't see any errors or
> > warnings using pt_errors/pt_warnings.
> 
> When you use TAL/METAL on an XML file, you have to explicitly declare
> 'tal' and 'metal' namespaces:
> 
>   <?xml version="1.0" encoding="iso-8859-1"?>
>   <html xmlns:tal="http://xml.zope.org/namespaces/tal"
>         xmlns:metal="http://xml.zope.org/namespaces/metal">
>     ...

Unfortunatelly after adding those to zopetop/www/widget_macros.pt I get a
different error:

  METALError: macro 'views/standard_macros/logged_user' has incompatible
  mode 'xml', at line 37, column 3

Does this mean you cannot mix HTML and XML templates?

Removing the <?xml?> declaration from widget_macros.pt seems to fix the
ZopeTop skin.

Marius Gedminas
-- 
Codeworks is available for Zope consulting -- http://www.codeworks.lt/