Build Body Transform
This script builds the body of the page. It includes two other scripts: buildTopPanel.rxsl and .
buildBody.rxsl
// -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
// -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
//
// Page to XHTML Transform: Build Body
//
// Author:
// Name : Hugh Field-Richards
// Email : hsfr@hsfr.org.uk
//
// Copyright 2025 Hugh Field-Richards.
//
// -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
// -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
stylesheet {
version "1.0"
xmlns "page" "http://www.hsfr.org.uk/Schema/Page"
xmlns "list" "http://www.hsfr.org.uk/Schema/List"
xmlns "link" "http://www.hsfr.org.uk/Schema/Link"
xmlns "text" "http://www.hsfr.org.uk/Schema/Text"
xmlns "news" "http://www.hsfr.org.uk/Schema/News"
xmlns "table" "http://www.hsfr.org.uk/Schema/Table"
xmlns "rexsel" "http://www.hsfr.org.uk/Schema/Rexsel/1.0"
// -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
// -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- INCLUDES *-*-*-*-*-*-*-*-*-*-*-*-*-*-*
// -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
include "buildTopPanel.xsl"
include "buildMenusPanel.xsl"
// -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
// -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- TEMPLATES -*-*-*-*-*-*-*-*-*-*-*-*-*-*
// -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
//
// The body has a single frame in which all the various panels site.
proc buildBody.htmlBody {
element "div" {
attribute "id" "topPanel"
call buildTopPanel.topPanel
}
if "//breadcrumbs//list:item[@id = $gPage]" {
element "div" {
attribute "id" "breadcrumbPanel"
call buildBody.buildBreadcrumbs
}
}
element "div" {
attribute "id" "contentPanel"
choose {
when "$gPage = 'home'" {
call buildBody.buildIndex
}
when "$gPage = 'faq'" {
call buildBody.buildFAQ
}
when "$gPage = 'news'" {
call buildBody.buildNews
}
otherwise {
apply-templates using "//content/page:content/*" scope "inline-text"
}
}
}
element "div" {
attribute "id" "copyrightPanel"
value "//page:copyright"
apply-templates using "//page:copyright/*" scope "inline-text"
}
}
// -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
//
// The Home Page is slightly different to the others. There are two
// columns: the left for standard content (id = 'body'), and the right
// for news etc. Because of the way that divs do not work vertically in
// sensible columns (the containing div never sets its height properly
// without tortuous CSS workings) I use a simple two cell table here.
// And devil take the purists.
proc buildBody.buildIndex {
element "table" {
attribute "id" "homePageTable"
element "tr" {
element "td" {
attribute "id" "leftPanel"
apply-templates using "//content/page:content/text:group[@id = 'body']/*" scope "inline-text"
}
element "td" {
attribute "id" "rightPanel"
element "div" {
attribute "id" "downloadPanel"
element "div" {
attribute "class" "downloadPanelText"
element "a" {
attribute "href" "downloads/rexselKernel-latest.tgz"
element "h2" {
text "Download Latest Kernel"
}
element "p" {
value "document('../../documentation/downloads.xml')//rexsel:versions[@id='rexselKernel']/rexsel:version/rexsel:version-number"
}
}
}
element "div" {
attribute "class" "downloadPanelText"
element "a" {
attribute "href" "downloads/crexsel-latest.tgz"
element "h2" {
text "Download Latest CRexsel"
}
element "p" {
value "document('../../documentation/downloads.xml')//rexsel:versions[@id='crexsel']/rexsel:version/rexsel:version-number"
}
}
}
element "div" {
attribute "class" "downloadPanelText"
element "a" {
attribute "href" "downloads/RexselEditor.dmg"
element "h2" {
text "Download Latest Editor"
}
element "p" {
value "document('../../documentation/downloads.xml')//rexsel:versions[@id='rexselEditor']/rexsel:version/rexsel:version-number"
}
}
}
}
element "div" {
attribute "id" "latestNewsPanel"
foreach "//news:channel" {
sort using "@id" descending number-sort
if "position() < 6" {
element "div" {
attribute "class" "mainNewsDate"
element "a" {
attribute "href" {
value "concat('news.html#', @id)"
}
value "news:date"
}
}
element "div" {
attribute "class" {
text "newsArticleBody"
}
value "news:description"
}
}
}
}
}
}
}
}
// -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
//
// The FAQ requires an index at the top.
proc buildBody.buildFAQ {
apply-templates using "//page:content/text:heading[@level = '1']" scope "inline-text"
element "div" {
attribute "class" "faqContents"
foreach "//page:content/text:group[@label = 'faqEntry']/text:heading[@level = '2']" {
element "div" {
attribute "class" "faqContentsItem"
element "a" {
attribute "href" {
value "concat('#', @id)"
}
apply-templates scope “inline-text"
}
}
}
}
foreach “//page:content//text:group[@label = 'faqEntry']" {
apply-templates scope "inline-text"
element "div" {
attribute "class" "returnToTop"
element "a" {
attribute "href" "#topOfPage"
value "//list:list[@id = 'headings']/list:item[@id = 'returnTop']"
}
}
}
}
// -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
//
// The News page requires an index at the top.
proc buildBody.buildNews {
apply-templates using "//content/page:content/*" scope "inline-text"
foreach "//news-articles/news:channel" {
sort using "@id" descending number-sort
element "a" {
attribute "name" {
value "@id"
}
}
element "div" {
attribute "class" "newsDateHeading"
value "news:date"
text " — "
value "news:title"
}
apply-templates using "news:text" scope "inline-text"
}
}
// -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
//
// The breadcrumbs menu on some documentation pages.
proc buildBody.buildBreadcrumbs {
element "ul" {
attribute "id" "crumbs"
foreach "//breadcrumbs//list:item[@id = $gPage]/ancestor-or-self::*" {
if "@id" {
element "li" {
element "a" {
attribute "href" {
value "link:link/@ref"
}
value "link:link"
if "not(position() = last())" {
text " > "
}
}
}
}
}
}
}
}
Copyright 2025 Hugh Field-Richards. All Rights Reserved.