Ticket #221 (closed task: invalid)
minor code syntax error on <link> tags in ATVideo
| Reported by: | datakid | Owned by: | andycat |
|---|---|---|---|
| Priority: | trivial | Milestone: | 4.9 |
| Component: | ATVideo | Severity: | |
| Keywords: | Cc: | ||
| Who will test this: | And |
Description
When creating the pot translation files for ATVideo, i18ndude (the translation string extractor) fails for ATVideo with the following errors:
$i18ndude rebuild-pot --pot $atvidedo.pot --create $plone .
There was an error processing ./skins/ATEngageVideo/RSS2.pt
Traceback (most recent call last):
File "/usr/lib/python2.4/site-packages/i18ndude-3.0-py2.4.egg/i18ndude/extract.py", line 476, in tal_strings
p.parseFile(filename)
File "/usr/lib/python2.4/site-packages/zope.tal-3.5.0-py2.4.egg/zope/tal/htmltalparser.py", line 122, in parseFile
self.parseString(data)
File "/usr/lib/python2.4/site-packages/zope.tal-3.5.0-py2.4.egg/zope/tal/htmltalparser.py", line 128, in parseString
self.feed(data)
File "/usr/lib/python2.4/HTMLParser.py", line 108, in feed
self.goahead(0)
File "/usr/lib/python2.4/HTMLParser.py", line 148, in goahead
k = self.parse_starttag(i)
File "/usr/lib/python2.4/HTMLParser.py", line 268, in parse_starttag
self.handle_starttag(tag, attrs)
File "/usr/lib/python2.4/site-packages/zope.tal-3.5.0-py2.4.egg/zope/tal/htmltalparser.py", line 147, in handle_starttag
self.getpos())
TALError: empty HTML tags cannot use tal:content: 'link', at line 32, column 9, in file ./skins/ATEngageVideo/RSS2.pt
There was an error processing ./browser/templates/rss_template.pt
Traceback (most recent call last):
File "/usr/lib/python2.4/site-packages/i18ndude-3.0-py2.4.egg/i18ndude/extract.py", line 476, in tal_strings
p.parseFile(filename)
File "/usr/lib/python2.4/site-packages/zope.tal-3.5.0-py2.4.egg/zope/tal/htmltalparser.py", line 122, in parseFile
self.parseString(data)
File "/usr/lib/python2.4/site-packages/zope.tal-3.5.0-py2.4.egg/zope/tal/htmltalparser.py", line 128, in parseString
self.feed(data)
File "/usr/lib/python2.4/HTMLParser.py", line 108, in feed
self.goahead(0)
File "/usr/lib/python2.4/HTMLParser.py", line 148, in goahead
k = self.parse_starttag(i)
File "/usr/lib/python2.4/HTMLParser.py", line 268, in parse_starttag
self.handle_starttag(tag, attrs)
File "/usr/lib/python2.4/site-packages/zope.tal-3.5.0-py2.4.egg/zope/tal/htmltalparser.py", line 147, in handle_starttag
self.getpos())
TALError: empty HTML tags cannot use tal:content: 'link', at line 26, column 3, in file ./browser/templates/rss_template.pt
On failure, i18ndude fails to create a pot file. Note that I have also tried this with the newer version of i18ndude (that uses python2.5) and it similarly fails.
I looked into these two files and they have other instances of link tags with tal:content - it's only failing on the first instance.
Neither of these files have any strings to translate, so I tried deleting them and running i18ndude again with success.
Is replacing these "link" tags with "a" tags a working solution?
#plone suggested I look at the definition of a link tag which was very clarifying, which is why I suggest the "a" tag solution
Attachments
Change History
comment:2 Changed 4 years ago by vik
The issue is that RSS is XML, and one of the elements is a non-empty link tag e.g. <link> http://foo.bar/baz</link> HTML, on the other hand uses only _empty_ link tags e.g. <link rel="foo" /> Non-empty link tags in HTML are forbidden.
i18ndude (via some TAL library) is trying to parse the .pt file as and HTML file, and the parser is failing on the non-empty link tag.
A temporary workaround is to change the <link> </link> tags to something else (e.g. linka) for the purposes of running i18ndude, then reverting them back to link.

sorry, that last line should read "which wasn't very clarifying"