annotate examples/tutorial/geddit/templates/info.xml @ 1043:a21009a2bc3a trunk

Return correct value and properly namespaced attribute name when matching namespaced attributes with XPath expressions (fixes #572; thanks to Olemis Lang <olemis+trac@gmail.com> for bug report and suggestion for fix).
author hodgestar
date Thu, 20 Mar 2014 12:58:48 +0000
parents e990fa05d80b
children
rev   line source
622
6780f1b1b20d GenshiTutorial: add Atom feeds.
cmlenz
parents:
diff changeset
1 <?xml version="1.0" encoding="utf-8"?>
6780f1b1b20d GenshiTutorial: add Atom feeds.
cmlenz
parents:
diff changeset
2 <feed xmlns="http://www.w3.org/2005/Atom"
6780f1b1b20d GenshiTutorial: add Atom feeds.
cmlenz
parents:
diff changeset
3 xmlns:py="http://genshi.edgewall.org/">
6780f1b1b20d GenshiTutorial: add Atom feeds.
cmlenz
parents:
diff changeset
4
6780f1b1b20d GenshiTutorial: add Atom feeds.
cmlenz
parents:
diff changeset
5 <title>Geddit: ${link.title}</title>
6780f1b1b20d GenshiTutorial: add Atom feeds.
cmlenz
parents:
diff changeset
6 <id href="${url('/info/%s/' % link.id)}"/>
6780f1b1b20d GenshiTutorial: add Atom feeds.
cmlenz
parents:
diff changeset
7 <link rel="alternate" href="${url('/info/%s/' % link.id)}" type="text/html"/>
6780f1b1b20d GenshiTutorial: add Atom feeds.
cmlenz
parents:
diff changeset
8 <link rel="self" href="${url('/feed/%s/' % link.id)}" type="application/atom+xml"/>
631
e990fa05d80b GenshiTutorial: implement the XSS section.
cmlenz
parents: 623
diff changeset
9 <updated py:with="time=link.comments and link.comments[-1].time or link.time">
622
6780f1b1b20d GenshiTutorial: add Atom feeds.
cmlenz
parents:
diff changeset
10 ${time.isoformat()}
6780f1b1b20d GenshiTutorial: add Atom feeds.
cmlenz
parents:
diff changeset
11 </updated>
6780f1b1b20d GenshiTutorial: add Atom feeds.
cmlenz
parents:
diff changeset
12
631
e990fa05d80b GenshiTutorial: implement the XSS section.
cmlenz
parents: 623
diff changeset
13 <?python from genshi import HTML ?>
622
6780f1b1b20d GenshiTutorial: add Atom feeds.
cmlenz
parents:
diff changeset
14 <entry py:for="idx, comment in enumerate(reversed(link.comments))">
6780f1b1b20d GenshiTutorial: add Atom feeds.
cmlenz
parents:
diff changeset
15 <title>Comment ${len(link.comments) - idx} on “${link.title}”</title>
6780f1b1b20d GenshiTutorial: add Atom feeds.
cmlenz
parents:
diff changeset
16 <link rel="alternate" href="${url('/info/%s/' % link.id)}#comment${idx}"
6780f1b1b20d GenshiTutorial: add Atom feeds.
cmlenz
parents:
diff changeset
17 type="text/html"/>
6780f1b1b20d GenshiTutorial: add Atom feeds.
cmlenz
parents:
diff changeset
18 <id>${url('/info/%s/' % link.id)}#comment${idx}</id>
6780f1b1b20d GenshiTutorial: add Atom feeds.
cmlenz
parents:
diff changeset
19 <author>
6780f1b1b20d GenshiTutorial: add Atom feeds.
cmlenz
parents:
diff changeset
20 <name>${comment.username}</name>
6780f1b1b20d GenshiTutorial: add Atom feeds.
cmlenz
parents:
diff changeset
21 </author>
6780f1b1b20d GenshiTutorial: add Atom feeds.
cmlenz
parents:
diff changeset
22 <updated>${comment.time.isoformat()}</updated>
631
e990fa05d80b GenshiTutorial: implement the XSS section.
cmlenz
parents: 623
diff changeset
23 <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
e990fa05d80b GenshiTutorial: implement the XSS section.
cmlenz
parents: 623
diff changeset
24 ${HTML(comment.content)}
e990fa05d80b GenshiTutorial: implement the XSS section.
cmlenz
parents: 623
diff changeset
25 </div></content>
622
6780f1b1b20d GenshiTutorial: add Atom feeds.
cmlenz
parents:
diff changeset
26 </entry>
6780f1b1b20d GenshiTutorial: add Atom feeds.
cmlenz
parents:
diff changeset
27
6780f1b1b20d GenshiTutorial: add Atom feeds.
cmlenz
parents:
diff changeset
28 </feed>
Copyright (C) 2012-2017 Edgewall Software