Re: [Zope-dev] Re: [ZPT] Order of attribute execution FeatureRequest

2002-05-13 Thread Jeffrey P Shell

On 5/13/02 1:51 PM, Jim Penny [EMAIL PROTECTED] wrote:

 On Mon, May 13, 2002 at 03:32:21PM -0400, Shane Hathaway wrote:
 Florent Guillaume wrote:
 Jim Penny  [EMAIL PROTECTED] wrote:
 
 Are you referring to what I call magic boolean attributes ?
 
 http://lists.zope.org/pipermail/zpt/2002-March/003013.html
 
 Yes, thanks very much, this is very helpful.  I see that you could find
 no documentation on this, and got no reply.  Is this intended to be a
 permanent feature, or is is experimental?
 
 
 I'm pretty sure it's permanent, only undocumented.
 
 Florent, do you have committer privileges?  You can certainly check in
 documentation of this behavior.  You can also add a comment to the Zope
 book.
 
 http://www.zope.org/Documentation/ZopeBook/AdvZPT.stx
 
 I will write up something and do the feedback thing in the Zope book.
 It seems to me it should be in both the advanced section and the ZPTRef
 section.  Would like a bit of guidance on the Ref writeup, i.e., what
 does ZC want to call it (presumably not magic boolean attributes)?
 

Boolean HTML Attributes perhaps?  From TAL/HTMLTALParser.py ::

BOOLEAN_HTML_ATTRS = [
# List of Boolean attributes in HTML that may be given in
# minimized form (e.g. img ismap rather than img ismap=)
# From http://www.w3.org/TR/xhtml1/#guidelines (C.10)
compact, nowrap, ismap, declare, noshade, checked,
disabled, readonly, multiple, selected, noresize,
defer
]

You should mention that these only get rendered in the classic HTML way when
a page template is in HTML mode (content type equals 'text/html'), which I
presume is the default.

-- 
Jeffrey P Shell
www.cuemedia.com




Industrie Toulouse on Zope
http://radio.weblogs.com/0106123/categories/zope/



___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Re: [ZPT] Order of attribute execution FeatureRequest

2002-05-10 Thread Chris Withers

Tim Hoffman wrote:
 
snip
 
 This I would imagine could introduce all sorts of nasty bugs.

Good points! On that basis, I retract my feature request ;-)

cheers,

Chris


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Re: [ZPT] Order of attribute execution FeatureRequest

2002-05-10 Thread Jeffrey P Shell

On 5/10/02 4:53 AM, Chris Withers [EMAIL PROTECTED] wrote:

 Jim Penny wrote:
 
 on the surface, to be pretty ugly.  I have said that there are three
 specific things I dislike about ZPT -- 0)  lots of things have changed
 spelling again -- request v. REQUEST, here v. context v. container v.
 this v. ? 
 
 Yeah, there was absolutely no need for this and I did find it extremely
 frustrating. That
 said, the whole area has always been a mess, particularly in DTML. I do,
 however, wish
 that Script (Python)'s and ZPT could have been consistent :-((

Me too.  I keep typing 'here' in Python Scripts now.  While I know I can
change the bindings, I'm sure that would just make more confusion for me
down the road.

In regards to request v. REQUEST, I do like the page templates spelling.
'request' is just another path root, and all path roots are lower case.

 1) infix notation that makes program scansion hard,
 
 You don't HAVE to use infix ;-)
 
 tr tal:repeat=x xes
 td tal:content=x/idan ID/td
 /tr
 
 ...can also be written as:
 
 tal:x repeat=x xes
 tr
 tdtal:x replace=x/id//td
 /tr
 /tal:x

I think this is another good feature of ZPT which seems almost like a side
benefit of XML Namespace usage (and instead of 'tal:x', you can also use
more meaningful terms like 'tal:loop').  As for program 'scansion', I don't
view a Page Template as program.  But I think programmer readability can be
achieved just by good formatting.  And when using some HTML tools, whether
they're text oriented, visually, or both, some of them hilight unknown
attributes differently.  GoLive 6 by default colorizes unknown
attributes/tags in orange, while known ones are in blue.  Attribute values
remain in brown.  So, a combination of good formatting and a half decent
editor can yield good usability.  If these are problems for the
pure-programming set, there is still DTML.  And, if anyone can plug in a
good XSLT processor, that could open up another alternative templating
system.  XHTML aware editors should present the least amount of problems, as
namespaces (in theory) shouldn't cause any confusion.

 2) the
 order of operations, which I think is baroque.  Six levels of precendence
 for eight statements is pretty amazing.  And it is certainly harder to
 explain/remember than things happen in the order you specify.
 
 *shrugs* I've done a u-turn on this. Tim's comments make it perfectly obvious
 why this needs to be the case, and at least it is very well defined what order
 things happen in (as Ken pointed out). My only beef is that define sometimes
 happens in an order that is less helpful than it could be ;-)
 
 tal:x repeat=fish fishes
  define=species fish/species
 
 ...doesn't do what I'd like it to ;-)

Evan Simpson explained this to me once in a way that made sense, but I can't
remember what it is right now.

[SNIP!]

-- 
Jeffrey P Shell
www.cuemedia.com




Industrie Toulouse on Zope
http://radio.weblogs.com/0106123/categories/zope/



___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Re: [ZPT] Order of attribute execution FeatureRequest

2002-05-09 Thread Tim Hoffman

Hi

Just my 2c worth, but I would like to defend order of execution of 
ZPT. What it does mean for me is I can guaruntee zpt commands will
always be processed in a known order irrespective of where you 
put them in a tag, this I like ;-)

What I do miss is else  clause  but I think it would be probably
be too hard to implement, and too much of encouragement for people 
to start putting more logic in the template, so on the whole it
is probably best to leave it out.

See ya

T
On Fri, 2002-05-10 at 05:15, Jim Penny wrote:
 On Thu, May 09, 2002 at 04:07:14PM -0400, Ken Manheimer wrote:
  On Thu, 9 May 2002, Dieter Maurer wrote:
  
   Chris Withers writes:
 Jim Penny wrote:
  2) that is introduces some additional, fairly baroque magic in the
  order of execution of element type definitions.  I would have
  preferred that they be evaulated/performed in textual order.
  
  This is a case where i'd say baroque is intemperate.  The documention 
  ( http://dev.zope.org/Wikis/DevSite/Projects/ZPT/TAL%20Specification%201.4 )
  not only specifically declares the order of operations operations, but it 
  goes on to describe the rationale behind them!
  
  
  Now, if you _disagree_ with the choices, and can cite cases which
  substantiate your reasoning, then great, file a collector issue!  But
  calling it baroque implies that it's overelaborate and/or obscure to the
  informed user - neither of which seems, to me at least, to be the case.
  
 I'd second that... where do we stick feature requests like this?
  
  I would assume it's the Zope collector.  I suppose you could add comments
  in the ZPT wiki, as well.  If you see a glaring error, and feel it
  warrants stirring up a lot of attention, then post something to zope
  coders - but you've both been pretty vague about your complaints, i don't
  have the impression you are chafing from some particular error.
  
 
 Now, Ken, I think you ought to reread the thread.  Chris has
 consistently defended ZPT, except for this one feature.  I am
 ambivalent towards ZPT, but have stated that I will be, and am in fact, 
 moving towards using them nearly exclusively.  I am in this because I 
 felt that someone was being dumped on for daring to suggest that DTML 
 is at least cosmetically better.  
 
 I have also said that, while ZPT is not as warty as DTML, ZPT looks,
 on the surface, to be pretty ugly.  I have said that there are three
 specific things I dislike about ZPT -- 0)  lots of things have changed
 spelling again -- request v. REQUEST, here v. context v. container v.
 this v. ? 1) infix notation that makes program scansion hard, 2) the 
 order of operations, which I think is baroque.  Six levels of precendence 
 for eight statements is pretty amazing.  And it is certainly harder to 
 explain/remember than things happen in the order you specify.
 
 I will add a fourth nit -- I cannot see why attributes should be plural
 when every other command is singular.  Certainly it feels like attribute
 ought to be an acceptable spelling of the atttributes command!
 
 Now I will turn around and say what I do like about ZPT.
 Well-formed-ness is indeed nice.  The reduction of magic in variable
 lookup is nice.  The | nothing convention is very nice when used
 content or replace statements -- it makes it very easy to use the same
 form for both input and error processing -- something that is almost by
 itself worth the price of admission.  In fact, this is not really
 mentioned in the ZopeBook or ZPT Reference, it is shown only (on page
 143) in combination with an unnecessary condition command.  I also missed 
 the | default convention that I can see as very useful.
 
 My most-missed DTML feature has not been mentioned at all -- it is not
 loop batching -- it is the dtml-else option of dtml-in -- which made it
 much easier to handle the nothing found case.
 
 I also have not found a convention that I am comfortable with on
 handling check-boxes and radio buttons in error processing.  But I
 expect to!
 
 Jim Penny
 
 
   I think the order is irrelevant because the DOM considers
   attributes unordered. Not good to implement things against the standard
   model.
  
  Attributes are unordered in the traversal, but of course the processing of 
  the resulting structure (the semantics) is up to the application!  And the 
  documentation is very clear about how the application behaves - with good 
  motivation.
  
   Furthermore, changing this facet in the implementation will break
   lots of exiting templates.
   
   Where do we condemn feature requests like this?
  
  :-)
  
  I imagine whoever is responsible for PageTemplates will float a proposal
  for changes if they're convinced any are necessary.
  
  -- 
  Ken
  [EMAIL PROTECTED]
  
 
 
 ___
 Zope-Dev maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope-dev
 **  No cross posts or HTML encoding!  **
 (Related lists - 
  

Re: [Zope-dev] Re: [ZPT] Order of attribute execution FeatureRequest

2002-05-09 Thread Tim Hoffman

HI Jim

It's a good point you raise.

I personally don't consider tal: and metal: tags to really be a
traditional programming language, more a way of including directives
and/or python into an XML/html namespace.

I think it would depend if you consider each tal: statement in 
a tag to be all part of a single statement. I view it as being 
a number of seperate attributes in a xml/html tag, and attributes within
a tag are typically order independant.

ie img src=file.gif border=0 vspace=1 hspace=1
or img border=0 vspace=1 hspace=1 src=file.gif

render exactly the same thing.

In addition event handlers in html ie onClick onBlur etc
are all order independant.

now adding tal: attributes that where order dependant would seem
to fly in the face of that convention. (Admittedely there are probably
no strange dependancies that could be introduced with different orders 
of border, src etc)

It would also be potentially dangerous have specific authored ordering
when non programmers start editing page templates, and accidentally
change the order of tags because they looked nice in a different order,
or when someone uses a graphical html editor, I have seen ones, where
you are given a nice dialog box to edit attributes of a tag,
and when it write the values back it always writes them in it's
internally specified order not the order you specify.

This I would imagine could introduce all sorts of nasty bugs.

On the basis of in place ordering would it also mean that a attribute
should be declared before a tal:attributes could be used.

Within an attribute ie tal:define the statements are executed in the
order they are specified, which does make sense.

I suppose I have put forward more than 2c now ;-)

T



  
 
On Fri, 2002-05-10 at 09:30, Jim Penny wrote:
 On Fri, May 10, 2002 at 09:07:26AM +0800, Tim Hoffman wrote:
  Hi
  
  Just my 2c worth, but I would like to defend order of execution of 
  ZPT. What it does mean for me is I can guaruntee zpt commands will
  always be processed in a known order irrespective of where you 
  put them in a tag, this I like ;-)
 
 Would you defend a python interpreter that always moved definitions
 ahead of conditionals ahead of loops?  
 
 Does even a intentionally limited templating language have the right
 to second-guess the programmer and re-arrange the order of written
 commands?
 
 Yes, I am aware that 'C' and fortran and many other languages may do
 rearrangement of arithmetic expression, and that this may be
 side-effectful.  But, can you point me to any other language that 
 reorders looping and conditionals?
 
 Jim
 
 
  
  What I do miss is else  clause  but I think it would be probably
  be too hard to implement, and too much of encouragement for people 
  to start putting more logic in the template, so on the whole it
  is probably best to leave it out.
  
  See ya




___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )