Genshi 表循环

发布于 2024-08-12 16:12:58 字数 584 浏览 2 评论 0原文

这个 Genshi 模板有什么问题:

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

我收到此错误:

genshi.template.base.TemplateSyntaxError:格式不正确(无效标记):第 7 行,第 14 列(templates/index2.html,第 7 行)

似乎表循环有问题......我不知道。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

变身佩奇 2024-08-19 16:12:58

我从未使用过 Genshi,但他们的 允许的处理指令列表py:for 之间没有任何空格。尝试删除该空格。无论如何,第 7 行第 14 列位于冒号或空格上,具体取决于您是从 0 还是从 1 数起,对吧?

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?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文