Description

This is the RELAX NG schema for the XML scraps used in the Paloose CMS. It is not used except to check the scraps when developing a new site. It saves a lot of pain when debugging.

Global Parameters

The page id derived from the sitemap and is usually the file name without the extension.

page
=
No default/select value

Set to true in admin pipeline, otherwise left as false.

admin
=
0

The short name used in the admin sessions.

sessionUser
=
No default/select value

The long name used in the admin sessions.

sessionFullname
=
No default/select value

Locale information from the sitemap (query string parameter).

locale
=
No default/select value

Global Variables

Global variable for the page name.

gPage
=

Global variable for the admin parameter.

gAdmin
=

Global variable for the short name session user parameter.

gSessionUser
=

Global variable for the full name session user parameter.

gFullName
=

Global variable for the page title. If it is not present in the source file then a default is used.

gPageTitle
=
<xsl:choose>......</xsl:choose>
<xsl:choose>
<xsl:when test="string-length( //page:meta/page:pageTitle ) > 0">......</xsl:when>
<xsl:whentest="string-length( //page:meta/page:pageTitle ) > 0">
<xsl:value-of select="//page:meta/page:pageTitle"/>
</xsl:when>
<xsl:otherwise>......</xsl:otherwise>
<xsl:otherwise>
<xsl:value-of select="'Paloose'"/>
</xsl:otherwise>
</xsl:choose>

Global Variables

Comma separated list of style files. But the styles files use a semicolon (don't ask!).

Path to CSS files directory.

gCSSFilesDir
=
'/pp/resources/styles/'

Comma separated list of CSS files.

gCSSFiles
=
'paloose.css,topPanel.css,menusPanel.css,text.css,faq.css,jqueryslidemenu.css,breadcrumb.css,ppForms.css'

Path to script files directory.

gScriptFilesDir
=
'/pp/resources/scripts/'

Semicolon separated list of script files.

gScriptFiles
=
'jquery.js;jqueryslidemenu.js'

Root Template

Where it all starts. It should not be necessary to change anything in here. The main user change area is all within the buildBody etc.

/
=
<xsl:element name="html">......</xsl:element>
<xsl:elementname="html">
<xsl:attribute name="lang">en</xsl:attribute>
<xsl:element name="head">......</xsl:element>
<xsl:elementname="head">
<xsl:call-template name="buildHeader.htmlHead">......</xsl:call-template>
<xsl:call-templatename="buildHeader.htmlHead">
<xsl:with-param name="inTitle"select="$gPageTitle"/>
<xsl:with-param name="inStylesList"select="$gCSSFiles"/>
<xsl:with-param name="inStylesDir"select="$gCSSFilesDir"/>
<xsl:with-param name="inScriptsList"select="$gScriptFiles"/>
<xsl:with-param name="inScriptsDir"select="$gScriptFilesDir"/>
</xsl:call-template>
</xsl:element>
<xsl:element name="body">......</xsl:element>
<xsl:elementname="body">
<xsl:element name="a">......</xsl:element>
<xsl:elementname="a">
<xsl:attribute name="name">topOfPage</xsl:attribute>
</xsl:element>
<xsl:element name="div">......</xsl:element>
<xsl:elementname="div">
<xsl:attribute name="id">bodyFrame</xsl:attribute>
<xsl:call-template name="buildBody.htmlBody"/>
</xsl:element>
</xsl:element>
</xsl:element>

Includes

Any external XSL files to be included go here. These go at the end to make sure the above override them.

buildHeader.xsl
buildBody.xsl
text2html.xsl

Utility functions

common.substring-after-last is required because XSL does not have the function.

=
<xsl:param name="string"/>
<xsl:param name="delimiter"/>
<xsl:choose>......</xsl:choose>
<xsl:choose>
<xsl:when test="contains($string, $delimiter)">......</xsl:when>
<xsl:whentest="contains($string, $delimiter)">
<xsl:call-template name="common.substring-after-last">......</xsl:call-template>
<xsl:call-templatename="common.substring-after-last">
<xsl:with-param name="string"select="substring-after($string, $delimiter)"/>
<xsl:with-param name="delimiter"select="$delimiter"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>......</xsl:otherwise>
<xsl:otherwise>
<xsl:value-of select="$string"/>
</xsl:otherwise>
</xsl:choose>

Soak up any remaining elements not processed by the above.

node()|@*
=
<xsl:copy>......</xsl:copy>
<xsl:copy>
<xsl:apply-templates select="@*"/>
<xsl:apply-templates/>
</xsl:copy>