[EMAIL PROTECTED] wrote:
> I'm using Kid in TurboGears and trying to understand Kid stuff....
> 
> What is purpose of xmlns:py?  Why can't you just use xmlns?
> 
> If I replace this...
> 
> <html xmlns:py="http://purl.org/kid/ns#";
>       xmlns="http://www.w3.org/1999/xhtml";
>       py:extends="sitetemplate">
> 
> with this....
> 
> <html xmlns="http://purl.org/kid/ns#"; py:extends="sitetemplate">
> 
> I get problems?...WHY?

Because that's how xml namespaces work.

<html xmlns:py="http://purl.org/kid/ns#";
        xmlns="http://www.w3.org/1999/xhtml";
        py:extends="sitetemplate">

Includes 2 definitions: the xhtml namespace 
(http://www.w3.org/1999/xhtml) which is given no prefix and the kid 
namespace (http://purl.org/kid/ns#) which has the prefix "py". Very 
loosely you can compare this to importing python modules:

from xhtml import *
import kid as py

You example snippet then has one tag and one attribute (excluding the 
xmlns attributes) -- the tag is "html" which is in the default (i.e. 
XHTML) namespace, and the attribute is "py:extends" which is in the kid 
namespace (note that, just like in the python pseudocode the use of "py" 
as the prefix is entirely arbitary; you could use "kid" or "ihgsdfi" or 
whatever, as long as you're consistent).

Now compare your replacement example:
<html xmlns="http://purl.org/kid/ns#"; py:extends="sitetemplate">
You now have an tag "html" in the kid namespace as an unknown namespace 
prefix "py". That's why you have problems.

> Also, why does URL end with a #?  What does # do?

Because the full string, including the "#" is the URI for the kid 
namespace. There's no intrinsic reason for the # but it needs to be 
included to correctly identify the kid namespace.

-- 
"The universe doesn't care what you believe. The wonderful thing about 
science is that it doesn't ask for your faith, it just asks for your 
eyes" --- http://xkcd.com/c154.html

-------------------------------------------------------------------------
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