Michael Gratton wrote:
> Not at all. If you're using a DTD/schema/editor/validator strict enough
> that it won't allow elements outside the XHTML name space to appear in
> random places in you documents, it won't allow attributes outside the
> default name space either. Conversely, if it is lax enough to allow the
> kid attributes, it will likely allow elements in the Kid name space as
> well.

That's right, so let's think about it more concretely.

One problem that I had in mind is that in most cases you need a base 
element so that the construct makes sense. The only attributes which 
seem to make sense without a base element are py:replace, and maybe
py:if, py:for, py:def and py:match if this is interpreted as applying 
only to the child elements.

Another problem is that you have no attribute value if you use element 
names instead of tag names. All these attributes do not make any sense 
without a value. So you would need to introduce a dummy attribute name 
to hold the value (you called it "value", maybe we should call it "py" 
because it's Python code) which is not much better than a dummy element 
name. The one thing that you can spare is the py:strip="True" (so there 
would have been no need to invent py:replace).

Let me summarize. The suggested syntax is that

<py:xyz py="code">...</py:xyz>

should be equivalent to:

<p py:xyz="code" py:strip="True" ...>...</p>

I think that's what you have in mind, right?

If you use this syntax, py:replace becomes actually unnecessary because 
you can write

<py:content py="code"/>

instead of

<p py:replace="code"/>

The suggested syntax may also solve the following:
http://www.kid-templating.org/trac/ticket/33

As far as I see it boils down to the question whether extending the 
syntax is justified by sparing a py:strip="True" in some situations.

This leads me to the following alternative suggestion:

Let's allow only py:strip for the element name. I.e.

<py:strip ...>...</py:strip>

would be equivalent to

<p py:strip="True" ...>...</p>

Thoughts? Does this makes sense?

-- Chris

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
kid-template-discuss mailing list
kid-template-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kid-template-discuss

Reply via email to