<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html
  xmlns="http://www.w3.org/1999/xhtml"
  xmlns:tal="http://purl.org/petal/1.0/"
  tal:define="rss_title rss/channel --title;
              rss_link  rss/channel --link;
              rss_desc  rss/channel --description;
              rss_items rss/items">

  <head>
    <title tal:content="rss_title">This is the RSS title</title>
  </head>
  <body>
    <h1>
      <a
        href="#"
        tal:content="rss_title"
        tal:attributes="href rss_link; title rss_desc"
      >This is the RSS title</a>
    </h1>
    <ul>
      <li tal:repeat="item rss_items">
        <a
          href="#"
          tal:content="item/title"
          tal:attributes="href item/link"
        >RSS item</a>
      </li>
    </ul>
  </body>
</html>

Figure 1: The complete Petal template.

Back to Article