% use Apache::Request; my $apr = Apache::Request->instance($r); my $sect = $apr->param('section'); $r->no_cache(1); my $this_page = $r->uri; my ($prev, $next); my $sects = findvalue('count(/article/sect1)'); $sects = "$sects"; if ($sects > 1) { if ($sect >= $sects) { $prev = $sects - 1; } elsif ($sect <= 1) { $next = 2; } else { $prev = $sect - 1; $next = $sect + 1; } } %> <% $t->{'xref'}{testcode} = sub { my ($node, $t) = @_; my $id = findvalue('@linkend', $node); my ($dest) = findnodes("id('$id')/title"); my $sect = findvalue("count(ancestor::sect1/preceding-sibling::sect1) + 1", $dest); $t->{pre} = "{pre} .= $id . '">'; $t->{pre} .= findvalue("id('$id')/title/text()"); $t->{post} = ''; return -1; }; %>
<%= spacer(10,1) %> |
<%
if (!$sect) {
# display title/TOC page
print apply_templates('/article/artheader/*');
my $page = 0;
foreach my $sect (findnodes('/article/sect1')) {
$page++;
print "";
print findvalue('title/text()', $sect);
print " \n"; } %> <% } else { %>
<% # display particular page foreach my $section (findnodes("/article/sect1[$sect]")) { # should only be 1 print apply_templates($section); } if (@footnotes) { print "
"; } } if ($sect) { %>
<% } %>
|
<%= spacer(10,1) %> |