Genshi 表循环
这个 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我从未使用过 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 thefor
. 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?