FBML 和 HTMLParser 错误

发布于 2024-08-09 19:13:19 字数 1174 浏览 3 评论 0原文

下面的代码:

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:fb="http://www.facebook.com/2008/fbml"
      xml:lang="en" lang="en">
<head>
    <title>FB Test</title>  
</head>

<body>
    <a href="#" onclick="FB.Connect.inviteConnectUsers();">Test</a>
    <fb:serverfbml style="width: 350px;">  
        <script type="text/fbml">
            <fb:connect-form action="http://127.0.0.1/post_invite">     
            </fb:connect-form>
        </script>
    </fb:serverfbml>
</body>
</html>

导致以下错误:

   - Warning: Compilation failed
   - Warning: <class 'zope.tal.htmltalparser.NestingError'>: Open tags <html>, <body>, <fb:serverfbml>, <script> do not match close tag </fb:connect-form>, at line 16, column 4
PTRuntimeError: ['Compilation failed', u"<class 'zope.tal.htmltalparser.NestingError'>: Open tags <html>, <body>, <fb:serverfbml>, <script> do not match close tag </fb:connect-form>, at line 16, column 4"]

但该结构对我来说似乎有效......

The below code:

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:fb="http://www.facebook.com/2008/fbml"
      xml:lang="en" lang="en">
<head>
    <title>FB Test</title>  
</head>

<body>
    <a href="#" onclick="FB.Connect.inviteConnectUsers();">Test</a>
    <fb:serverfbml style="width: 350px;">  
        <script type="text/fbml">
            <fb:connect-form action="http://127.0.0.1/post_invite">     
            </fb:connect-form>
        </script>
    </fb:serverfbml>
</body>
</html>

Results in the following error:

   - Warning: Compilation failed
   - Warning: <class 'zope.tal.htmltalparser.NestingError'>: Open tags <html>, <body>, <fb:serverfbml>, <script> do not match close tag </fb:connect-form>, at line 16, column 4
PTRuntimeError: ['Compilation failed', u"<class 'zope.tal.htmltalparser.NestingError'>: Open tags <html>, <body>, <fb:serverfbml>, <script> do not match close tag </fb:connect-form>, at line 16, column 4"]

Yet the structure seems valid to me...

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

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

发布评论

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

评论(2

稚气少女 2024-08-16 19:13:19

您不能将标签放入

<script type="text/fbml" tal:content="structure string:
    <fb:connect-form action="http://127.0.0.1/post_invite"<         
    >/fb:connect-form<
"></script>

You can't put tags inside of a <script> tag, and the strict ZPT parser is complaining about that. You'll have to somehow escape the contents, like with a tal:content="structure string:" construct:

<script type="text/fbml" tal:content="structure string:
    <fb:connect-form action="http://127.0.0.1/post_invite"<         
    >/fb:connect-form<
"></script>
烟酒忠诚 2024-08-16 19:13:19

据我所知,脚本标签不得包含 xml。

您可以将内容包含在 xml 注释中,看看是否有效。

The script tag must not contain xml to my knowledge.

You could enclose the contents in xml comments and see if that works.

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