Example 17-31: XSQL page to display list of topics for a forum

<?xml version="1.0"?>
<!-- ForumTopics.xsql: Show list of topics for a forum -->
<?xml-stylesheet type="text/xsl" href="ForumStyle.xsl"?>
<page connection="xmlbook" xmlns:xsql="urn:oracle-xsql">
  <!-- Include request params so Actions can check for forumuser cookie -->
  <xsql:include-request-params/>
  <xsql:action handler="Paging" rows-per-page="5" url-params="id">
      select count(t.id) as "total"
      from forum_topic t
     where forumid = {@id}
  </xsql:action>
  <breadcrumbs>
    <xsql:query>
      select name as "forumname", id as "forumid"
      from forum
      where id = {@id}
    </xsql:query>
  </breadcrumbs>
  <actions>
    <link page="EnterForumTopic.xsql" label="Enter a New Topic" login="yes">
      <xsql:include-param name="id"/>
    </link>
    <link page="Search.xsql" label="Search">
      <xsql:include-param name="id"/>
    </link>
  </actions>
  <data>
    <xsql:query max-rows="{@paging-max}" skip-rows="{@paging-skip}">
      select t.id              as h_id,
             t.title           as "Topic",
             t.userid          as "Started_By",
             postings-1        as "Replies",
             to_char(lastpost,'dd Mon YYYY, hh24:mi') as "Last_Post"
        from forum_topic t
       where forumid = {@id}
        order by 5 desc
    </xsql:query>
  </data>
</page>