On 11/25/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> TurboGears created following Kid template code.  I understand
> that py:match basically creates new element types but yet
> I still can't figure out what py:match is doing below.
> Any help greatly appreciated....
>
>
> <html xmlns:py="http://purl.org/kid/ns#";
>       xmlns="http://www.w3.org/1999/xhtml";
>       py:extends="sitetemplate">
> <head py:match="item.tag=='{http://www.w3.org/1999/xhtml}head'"
>       py:attrs="item.items()">
>         <title>SnakeCharmers</title>
>         <link href="/css/main.css" type="text/css" rel="stylesheet"/>
>         <meta py:replace="item[:]"/>
> </head>
> <body py:match="item.tag=='{http://www.w3.org/1999/xhtml}body'"
>       py:attrs="item.items()">
>
> *** Why is '{http://www.w3.org/1999/xhtml}' in the py:match piece?  What is 
> its
>     purpose?
>
> *** Is py:attrs just placing original attributes of <head> and <body> back in
>     those elements?

I believe I answer this in the TG list yesterday but here it goes.

remenber those are in the form of master/slave templates, so the code
you have is from master.kid, both tags what they do is something like
this "if the slave has redefined the head tag, replace the default
(what you see here) with that", this is so the slave pages can be of
some other type for example plain html, and to be able to put more
stuff into the head tag like redirects or some other meta.

>
> Chris
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> kid-template-discuss mailing list
> kid-template-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/kid-template-discuss
>

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
kid-template-discuss mailing list
kid-template-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kid-template-discuss

Reply via email to