pythongenshi

Genshi table loop


What is wrong with this Genshi template:

<html xmlns:py="http://genshi.edgewall.org/">     
  <head>
    <title py:content="title"></title>
  </head>
  <body>  
    <left>
    <table py: for="i in range(1, len(ctabl))">
        <li py: for="e in ctabl[i]">
            ${e}
        </li> 
    </table>
  </body>
</html>

I get this error:

genshi.template.base.TemplateSyntaxError: not well-formed (invalid token): line 7, column 14 (templates/index2.html, line 7)

Seems that there is something wrong with the table loop... I don't know.


Solution

  • I've never used Genshi, but their list of allowed processing directives do not have any spaces between py, the :, and the for. Try removing that space. And anyway, Line 7, Column 14 is on the colon or the space, depending on whether you count from 0 or 1, right?