Domanda

Il codice seguente:

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

Risultati nel seguente errore:

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

Eppure la struttura mi sembra valida ...

È stato utile?

Soluzione

Non puoi inserire tag all'interno di un tag <script> e il rigoroso parser ZPT se ne lamenta. Dovrai in qualche modo sfuggire al contenuto, come con un tal: content = & Quot; struttura stringa: & Quot; costruire:

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

Altri suggerimenti

Il tag script non deve contenere xml per quanto ne so.

Potresti racchiudere il contenuto nei commenti XML e vedere se funziona.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top