Lastest status for Foundry:

- Navigation works now
- Foundry now needs an XSL 2 processor like Saxon HE
- Most stylesheet functions parameters and result now typed (one of the new features of XSL 2)


git-svn-id: https://svn.libreccm.org/ccm/trunk@2886 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2014-09-27 17:08:54 +00:00
parent 5ea5533f07
commit 639304add6
12 changed files with 428 additions and 470 deletions

View File

@ -33,8 +33,7 @@
<xsl:strip-space elements="*"/> <xsl:strip-space elements="*"/>
<xsl:template match="/foundry:documentation"> <xsl:template match="/foundry:documentation">
<xsl:value-of select="'&lt;!DOCTYPE HTML&gt;'" <xsl:text>&lt;!DOCTYPE HTML&gt;</xsl:text>
disable-output-escaping="yes" />
<html> <html>
<head> <head>
<meta http-equiv="content-type" <meta http-equiv="content-type"

View File

@ -31,7 +31,7 @@ processor, some are read from the configuration files of Foundry and some are de
xmlns:bebop="http://www.arsdigita.com/bebop/1.0" xmlns:bebop="http://www.arsdigita.com/bebop/1.0"
xmlns:foundry="http://foundry.libreccm.org" xmlns:foundry="http://foundry.libreccm.org"
xmlns:ui="http://www.arsdigita.com/ui/1.0" xmlns:ui="http://www.arsdigita.com/ui/1.0"
version="1.0"> version="2.0">
<!-- Foundry internal variables --> <!-- Foundry internal variables -->
<foundry:doc section="devel"> <foundry:doc section="devel">

View File

@ -22,22 +22,22 @@
--> -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:bebop="http://www.arsdigita.com/bebop/1.0" xmlns:bebop="http://www.arsdigita.com/bebop/1.0"
xmlns:cms="http://www.arsdigita.com/cms/1.0" xmlns:cms="http://www.arsdigita.com/cms/1.0"
xmlns:foundry="http://foundry.libreccm.org" xmlns:foundry="http://foundry.libreccm.org"
xmlns:func="http://exslt.org/functions"
xmlns:nav="http://ccm.redhat.com/navigation" xmlns:nav="http://ccm.redhat.com/navigation"
xmlns:ui="http://www.arsdigita.com/ui/1.0" xmlns:ui="http://www.arsdigita.com/ui/1.0"
version="1.0"> exclude-result-prefixes="xsl bebop cms nav ui"
version="2.0">
<foundry:doc section="user"> <foundry:doc section="user">
<foundry:doc-desc> <foundry:doc-desc>
Root element of a template. Generates the doctype statement and and Root element of a template. Generates the
<code>&lt;html&gt;</code> root element. <code>&lt;html&gt;</code> root element.
</foundry:doc-desc> </foundry:doc-desc>
</foundry:doc> </foundry:doc>
<xsl:template match="page-layout"> <xsl:template match="page-layout">
<xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html&gt;</xsl:text>
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<xsl:attribute name="lang"> <xsl:attribute name="lang">
<xsl:value-of select="$language"/> <xsl:value-of select="$language"/>
@ -80,16 +80,14 @@
Helper functions for generating the name of the colorset class. Helper functions for generating the name of the colorset class.
</foundry:doc-desc> </foundry:doc-desc>
</foundry:doc> </foundry:doc>
<func:function name="foundry:get-colorset"> <xsl:function name="foundry:get-colorset" as="xs:string">
<func:result>
<xsl:for-each select="$data-tree/nav:categoryMenu/nav:category/nav:category"> <xsl:for-each select="$data-tree/nav:categoryMenu/nav:category/nav:category">
<xsl:if test="@isSelected = 'true'"> <xsl:if test="@isSelected = 'true'">
<xsl:text>colorset_</xsl:text> <xsl:text>colorset_</xsl:text>
<xsl:value-of select="position()"/> <xsl:value-of select="position()"/>
</xsl:if> </xsl:if>
</xsl:for-each> </xsl:for-each>
</func:result> </xsl:function>
</func:function>
<foundry:doc section="devel"> <foundry:doc section="devel">
<foundry:doc-desc> <foundry:doc-desc>
@ -97,11 +95,9 @@
from the result tree XML. from the result tree XML.
</foundry:doc-desc> </foundry:doc-desc>
</foundry:doc> </foundry:doc>
<func:function name="foundry:get-content-type-name"> <xsl:function name="foundry:get-content-type-name" as="xs:string">
<func:result>
<xsl:value-of select="$data-tree//cms:item/type/label"/> <xsl:value-of select="$data-tree//cms:item/type/label"/>
</func:result> </xsl:function>
</func:function>
<foundry:doc section="devel"> <foundry:doc section="devel">
<foundry:doc-desc> <foundry:doc-desc>

View File

@ -20,7 +20,7 @@
--> -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"> version="2.0">
<xsl:import href="template-tags/data-tags.xsl"/> <xsl:import href="template-tags/data-tags.xsl"/>
<xsl:import href="template-tags/html-tags.xsl"/> <xsl:import href="template-tags/html-tags.xsl"/>

View File

@ -21,8 +21,7 @@
<!-- This file contains several template tags which output data from the result tree --> <!-- This file contains several template tags which output data from the result tree -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:foundry="http://foundry.libreccm.org" xmlns:foundry="http://foundry.libreccm.org"
xmlns:func="http://exslt.org/functions" version="2.0">
version="1.0">
<foundry:doc section="user" <foundry:doc section="user"
type="template-tag"> type="template-tag">

View File

@ -25,7 +25,7 @@
xmlns:foundry="http://foundry.libreccm.org" xmlns:foundry="http://foundry.libreccm.org"
xmlns:ui="http://www.arsdigita.com/ui/1.0" xmlns:ui="http://www.arsdigita.com/ui/1.0"
exclude-result-prefixes="xsl bebop foundry ui" exclude-result-prefixes="xsl bebop foundry ui"
version="1.0"> version="2.0">
<foundry:doc> <foundry:doc>
<foundry:doc-desc> <foundry:doc-desc>
@ -60,8 +60,8 @@
</foundry:doc-see-also> </foundry:doc-see-also>
</foundry:doc> </foundry:doc>
<xsl:template match="a"> <xsl:template match="a">
<xsl:param name="href" select="''"/> <xsl:param name="href" select="''" tunnel="yes"/>
<xsl:param name="title" select="''"/> <xsl:param name="title" select="''" tunnel="yes"/>
<a> <a>
<xsl:if test="./@download"> <xsl:if test="./@download">
@ -143,9 +143,9 @@
<span id="top"/> <span id="top"/>
<a href="#startcontent" accesskey="S" class="nav-hide"> <a href="#startcontent" accesskey="S" class="nav-hide">
<xsl:attribute name="title"> <xsl:attribute name="title">
<xsl:value-of select="foundry:get-static-text('layout/page/skipnav/title')"/> <xsl:value-of select="foundry:get-static-text('', 'layout/page/skipnav/title')"/>
</xsl:attribute> </xsl:attribute>
<xsl:value-of select="foundry:get-static-text('layout/page/skipnav/link')"/> <xsl:value-of select="foundry:get-static-text('', 'layout/page/skipnav/link')"/>
</a> </a>
<xsl:apply-templates/> <xsl:apply-templates/>
</body> </body>
@ -190,32 +190,44 @@
<xsl:template match="h1"> <xsl:template match="h1">
<xsl:call-template name="foundry:set-id-and-class"/> <xsl:call-template name="foundry:set-id-and-class"/>
<h1>
<xsl:apply-templates/> <xsl:apply-templates/>
</h1>
</xsl:template> </xsl:template>
<xsl:template match="h2"> <xsl:template match="h2">
<xsl:call-template name="foundry:set-id-and-class"/> <xsl:call-template name="foundry:set-id-and-class"/>
<h2>
<xsl:apply-templates/> <xsl:apply-templates/>
</h2>
</xsl:template> </xsl:template>
<xsl:template match="h3"> <xsl:template match="h3">
<xsl:call-template name="foundry:set-id-and-class"/> <xsl:call-template name="foundry:set-id-and-class"/>
<h3>
<xsl:apply-templates/> <xsl:apply-templates/>
</h3>
</xsl:template> </xsl:template>
<xsl:template match="h4"> <xsl:template match="h4">
<xsl:call-template name="foundry:set-id-and-class"/> <xsl:call-template name="foundry:set-id-and-class"/>
<h4>
<xsl:apply-templates/> <xsl:apply-templates/>
</h4>
</xsl:template> </xsl:template>
<xsl:template match="h5"> <xsl:template match="h5">
<xsl:call-template name="foundry:set-id-and-class"/> <xsl:call-template name="foundry:set-id-and-class"/>
<h5>
<xsl:apply-templates/> <xsl:apply-templates/>
</h5>
</xsl:template> </xsl:template>
<xsl:template match="h6"> <xsl:template match="h6">
<xsl:call-template name="foundry:set-id-and-class"/> <xsl:call-template name="foundry:set-id-and-class"/>
<h6>
<xsl:apply-templates/> <xsl:apply-templates/>
</h6>
</xsl:template> </xsl:template>
<foundry:doc section="user" type="template-tag"> <foundry:doc section="user" type="template-tag">
@ -316,12 +328,12 @@
</xsl:if> </xsl:if>
<xsl:if test="./@alt"> <xsl:if test="./@alt">
<xsl:attribute name="alt"> <xsl:attribute name="alt">
<xsl:value-of select="foundry:get-static-text('', ./@alt, 'false')"/> <xsl:value-of select="foundry:get-static-text('', ./@alt, false())"/>
</xsl:attribute> </xsl:attribute>
</xsl:if> </xsl:if>
<xsl:if test="./@title"> <xsl:if test="./@title">
<xsl:attribute name="title"> <xsl:attribute name="title">
<xsl:value-of select="foundry:get-static-text('', ./@title, 'false')"/> <xsl:value-of select="foundry:get-static-text('', ./@title, false())"/>
</xsl:attribute> </xsl:attribute>
</xsl:if> </xsl:if>
<xsl:if test="width"> <xsl:if test="width">
@ -337,6 +349,13 @@
</img> </img>
</xsl:template> </xsl:template>
<xsl:template match="li">
<li>
<xsl:call-template name="foundry:set-id-and-class"/>
<xsl:apply-templates/>
</li>
</xsl:template>
<foundry:doc section="user" type="template-tag"> <foundry:doc section="user" type="template-tag">
<foundry:doc-desc> <foundry:doc-desc>
Generates a HTML5 <code>main</code> element. Generates a HTML5 <code>main</code> element.
@ -397,6 +416,13 @@
</nav> </nav>
</xsl:template> </xsl:template>
<xsl:template match="ol">
<ul>
<xsl:call-template name="foundry:set-id-and-class"/>
<xsl:apply-templates/>
</ul>
</xsl:template>
<xsl:template match="p"> <xsl:template match="p">
<p> <p>
<xsl:call-template name="foundry:set-id-and-class"/> <xsl:call-template name="foundry:set-id-and-class"/>
@ -536,7 +562,12 @@
</title> </title>
</xsl:template> </xsl:template>
<xsl:template match="ul">
<ul>
<xsl:call-template name="foundry:set-id-and-class"/>
<xsl:apply-templates/>
</ul>
</xsl:template>

View File

@ -25,7 +25,7 @@
xmlns:bebop="http://www.arsdigita.com/bebop/1.0" xmlns:bebop="http://www.arsdigita.com/bebop/1.0"
xmlns:foundry="http://foundry.libreccm.org" xmlns:foundry="http://foundry.libreccm.org"
xmlns:ui="http://www.arsdigita.com/ui/1.0" xmlns:ui="http://www.arsdigita.com/ui/1.0"
version="1.0"> version="2.0">
<foundry:doc section="user" <foundry:doc section="user"
type="template-tag"> type="template-tag">
@ -180,7 +180,7 @@
</xsl:template> </xsl:template>
<xsl:template match="load-html5shiv"> <xsl:template match="load-html5shiv">
<xsl:value-of disable-output-escaping="yes" select="concat(' <xsl:value-of select="concat('
&lt;!-- &lt;!--
&lt;!-[if lt IE 9]&gt; &lt;!-[if lt IE 9]&gt;
&lt;script src=&quot;', $context-prefix, '/assets/html5shiv.js&quot;/&gt; &lt;script src=&quot;', $context-prefix, '/assets/html5shiv.js&quot;/&gt;

View File

@ -3,7 +3,6 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:foundry="http://foundry.libreccm.org" xmlns:foundry="http://foundry.libreccm.org"
xmlns:func="http://exslt.org/functions"
xmlns:bebop="http://www.arsdigita.com/bebop/1.0" xmlns:bebop="http://www.arsdigita.com/bebop/1.0"
xmlns:nav="http://ccm.redhat.com/navigation" xmlns:nav="http://ccm.redhat.com/navigation"
exclude-result-prefixes="xsl bebop foundry nav" exclude-result-prefixes="xsl bebop foundry nav"
@ -26,7 +25,7 @@
</foundry:doc-attribute> </foundry:doc-attribute>
<foundry:doc-desc> <foundry:doc-desc>
Environment for outputting the home link for a navigation/category system. This tag Environment for outputting the home link for a navigation/category system. This tag
only intializes the context. The link itself has to be rendered using the <code>a</code> only initialises the context. The link itself has to be rendered using the <code>a</code>
HTML tag. The title of the navigation is printed using the <code>navigation-title</code> HTML tag. The title of the navigation is printed using the <code>navigation-title</code>
tag. tag.
</foundry:doc-desc> </foundry:doc-desc>
@ -35,13 +34,13 @@
</foundry:doc> </foundry:doc>
<xsl:template match="navigation-home-link"> <xsl:template match="navigation-home-link">
<xsl:variable name="navigation-id" <xsl:variable name="navigation-id"
select="foundry:get-attribute-value('navigation-id', 'categoryMenu')"/> select="foundry:get-attribute-value(current(), 'navigation-id', 'categoryMenu')"/>
<xsl:apply-templates> <xsl:apply-templates>
<xsl:with-param name="href" <xsl:with-param name="href"
select="$data-tree//nav:categoryMenu[@id=$navigation-id]/nav:category/@url"/> select="$data-tree//nav:categoryMenu[@id=$navigation-id]/nav:category/@url"
<xsl:with-param name="navigation-id" select="$navigation-id"/> tunnel="yes"/>
<xsl:with-param name="title"> <xsl:with-param name="navigation-id" select="$navigation-id" tunnel="yes"/>
<xsl:with-param name="title" tunnel="yes">
<xsl:choose> <xsl:choose>
<xsl:when test="./@show-description-text = 'false'"> <xsl:when test="./@show-description-text = 'false'">
<xsl:choose> <xsl:choose>
@ -49,7 +48,7 @@
<xsl:value-of select="$data-tree//nav:categoryMenu[@id=$navigation-id]/nav:category/@title"/> <xsl:value-of select="$data-tree//nav:categoryMenu[@id=$navigation-id]/nav:category/@title"/>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:value-of select="foundry:get-static-text('navigation', $data-tree//nav:categoryMenu[@id=$navigation-id]/@navigation-id, 'false')"/> <xsl:value-of select="foundry:get-static-text('navigation', $data-tree//nav:categoryMenu[@id=$navigation-id]/@navigation-id, false())"/>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:when> </xsl:when>
@ -62,212 +61,73 @@
</xsl:template> </xsl:template>
<xsl:template match="navigation-home-link//navigation-title"> <xsl:template match="navigation-home-link//navigation-title">
<xsl:param name="navigation-id"/> <xsl:param name="navigation-id" tunnel="yes"/>
<xsl:value-of select="foundry:shying($data-tree//nav:categoryMenu[@id=$navigation-id]/nav:category/@title)"/> <xsl:value-of select="foundry:shying($data-tree//nav:categoryMenu[@id=$navigation-id]/nav:category/@title)"/>
</xsl:template> </xsl:template>
<xsl:template match="navigation"> <xsl:template match="navigation">
<apply-templates/> <xsl:apply-templates>
<xsl:apply-templates select=".//navigation-links">
<xsl:with-param name="navigation-id" <xsl:with-param name="navigation-id"
select="foundry:get-attribute-value('navigation-id', 'categoryMenu')"/> select="foundry:get-attribute-value(current(), 'navigation-id', 'categoryMenu')"
tunnel="yes"/>
<xsl:with-param name="with-colorset" <xsl:with-param name="with-colorset"
select="foundry:get-attribute-value('with-colorset', 'false')"/> select="foundry:get-attribute-value(current(), 'with-colorset', 'false')"
tunnel="yes"/>
<xsl:with-param name="min-level" <xsl:with-param name="min-level"
select="foundry:get-attribute-value('min-level', 1)"/> select="foundry:get-attribute-value(current(), 'min-level', 1)"
tunnel="yes"/>
<xsl:with-param name="max-level" <xsl:with-param name="max-level"
select="foundry:get-attribute-value('max-level', 999)"/> select="foundry:get-attribute-value(current(), 'max-level', 999)"
tunnel="yes"/>
<xsl:with-param name="show-description-text" <xsl:with-param name="show-description-text"
select="foundry:get-attribute-value('show-description-text', 'true')"/> select="foundry:get-attribute-value(current(), 'show-description-text', 'true')"
tunnel="yes"/>
</xsl:apply-templates> </xsl:apply-templates>
</xsl:template> </xsl:template>
<xsl:template match="navigation//navigation-links"> <xsl:template match="navigation//navigation-links">
<xsl:param name="navigation-id"/> <xsl:param name="navigation-id" tunnel="yes"/>
<xsl:param name="with-colorset"/> <xsl:param name="with-colorset" tunnel="yes"/>
<xsl:param name="min-level"/> <xsl:param name="min-level" tunnel="yes"/>
<xsl:param name="max-level"/> <xsl:param name="max-level" tunnel="yes"/>
<xsl:param name="show-description-text"/> <xsl:param name="show-description-text" tunnel="yes"/>
<xsl:param name="current-level" select="1"/> <xsl:param name="current-level" select="1" tunnel="yes"/>
<xsl:param name="current-level-tree" select="$data-tree//nav:categoryMenu[@id=$navigation-id]/nav:category/nav:category"/> <xsl:param name="current-level-tree"
select="$data-tree//nav:categoryMenu[@id=$navigation-id]/nav:category/nav:category"
<dl> tunnel="yes"/>
<dt>navigation-id</dt>
<dd><xsl:value-of select="$navigation-id"/></dd>
<dt>with-colorset</dt>
<dd><xsl:value-of select="$with-colorset"/></dd>
<dt>min-level</dt>
<dd><xsl:value-of select="$min-level"/></dd>
<dt>max-level</dt>
<dd><xsl:value-of select="$max-level"/></dd>
<dt>current-level</dt>
<dd><xsl:value-of select="$current-level"/></dd>
</dl>
<xsl:choose>
<xsl:when test="($current-level &gt;= $min-level) and ($current-level &lt;= $max-level)">
<xsl:apply-templates>
<xsl:with-param name="navigation-id" select="$navigation-id"/>
<xsl:with-param name="with-colorset" select="$with-colorset"/>
<xsl:with-param name="min-level" select="$min-level"/>
<xsl:with-param name="max-level" select="$max-level"/>
<xsl:with-param name="show-description-text" select="$show-description-text"/>
<xsl:with-param name="current-level" select="1"/>
<xsl:with-param name="current-level-tree" select="$current-level-tree"/>
<xsl:with-param name="navigation-links-tree" select="."/>
</xsl:apply-templates>
</xsl:when>
<xsl:when test="($current-level &lt; $min-level) and $current-level-tree/nav:category">
<xsl:apply-templates select=".">
<xsl:with-param name="navigation-id" select="$navigation-id"/>
<xsl:with-param name="with-colorset" select="$with-colorset"/>
<xsl:with-param name="min-level" select="$min-level"/>
<xsl:with-param name="max-level" select="$max-level"/>
<xsl:with-param name="show-description-text" select="$show-description-text"/>
<xsl:with-param name="current-level" select="$current-level + 1"/>
<xsl:with-param name="current-level-tree"
select="$current-level-tree/nav:category"/>
<xsl:with-param name="navigation-links-tree" select="."/>
</xsl:apply-templates>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="navigationlinks//navigation-link">
<xsl:param name="navigation-id"/>
<xsl:param name="with-colorset"/>
<xsl:param name="min-level"/>
<xsl:param name="max-level"/>
<xsl:param name="show-description-text"/>
<xsl:param name="current-level"/>
<xsl:param name="current-level-tree"/>
<xsl:param name="navigation-links-tree"/>
<xsl:variable name="link-tree" select="."/>
<xsl:for-each select="$current-level-tree">
<xsl:apply-templates select="$link-tree">
<xsl:with-param name="navigation-id" select="$navigation-id"/>
<xsl:with-param name="with-colorset" select="$with-colorset"/>
<xsl:with-param name="min-level" select="$min-level"/>
<xsl:with-param name="max-level" select="$max-level"/>
<xsl:with-param name="show-description-text"
select="show-description-text"/>
<xsl:with-param name="current-level" select="$current-level"/>
<xsl:with-param name="current-level-tree" select="$current-level-tree"/>
<xsl:with-param name="navigation-links-tree" select="$navigation-links-tree"/>
<xsl:with-param name="href" select="./@url"/>
<xsl:with-param name="title">
<xsl:choose>
<xsl:when test="$show-description-text and ./@description">
<xsl:value-of select="./@description"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="./@title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
<xsl:with-param name="link-label" select="./@title"/>
</xsl:apply-templates>
</xsl:for-each>
</xsl:template>
<xsl:template match="navigation-link//navigation-link-label">
<xsl:param name="link-label"/>
<xsl:value-of select="$link-label"/>
</xsl:template>
<xsl:template match="navigation-link//navigation-sublinks">
<xsl:param name="navigation-id"/>
<xsl:param name="with-colorset"/>
<xsl:param name="min-level"/>
<xsl:param name="max-level"/>
<xsl:param name="show-description-text"/>
<xsl:param name="current-level"/>
<xsl:param name="current-level-tree"/>
<xsl:param name="navigation-links-tree"/>
<xsl:if test="($current-level &lt;= $max-level) and $current-level-tree/nav:category">
<xsl:apply-templates select="$navigation-links-tree">
<xsl:with-param name="navigation-id" select="$navigation-id"/>
<xsl:with-param name="with-colorset" select="$with-colorset"/>
<xsl:with-param name="min-level" select="$min-level"/>
<xsl:with-param name="max-level" select="$max-level"/>
<xsl:with-param name="show-description-text" select="$show-description-text"/>
<xsl:with-param name="current-level" select="$current-level + 1"/>
<xsl:with-param name="navigation-links-tree" select="$navigation-links-tree"/>
</xsl:apply-templates>
</xsl:if>
</xsl:template>
<!--<xsl:template match="navigation-layout">
<xsl:apply-templates>
<xsl:with-param name="navigation-id"
select="foundry:get-attribute-value('navigation-id', 'categoryMenu')"/>
<xsl:with-param name="with-colorset"
select="foundry:get-attribute-value('with-colorset', 'false')"/>
<xsl:with-param name="min-level"
select="foundry:get-attribute-value('min-level', '1')"/>
<xsl:with-param name="max-level"
select="foundry:get-attribute-value('max-level', '999')"/>
<xsl:with-param name="show-description-text"
select="foundry:get-attribute-value('show-description-text', 'true')"/>
<xsl:with-param name="current-level-tree"
select="$data-tree//nav:categoryMenu[@id=foundry:get-attribute-value('navigation-id', 'categoryMenu')]/nav:category/nav:category"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="navigation-layout//navigation-link-list"
name="navigation-link-list">
<xsl:param name="navigation-id"/>
<xsl:param name="with-colorset"/>
<xsl:param name="min-level"/>
<xsl:param name="max-level"/>
<xsl:param name="show-description-text"/>
<xsl:param name="current-level" select="1"/>
<xsl:param name="current-level-tree"/>
<xsl:param name="navigation-link-layout" select="."/>
<xsl:message> <xsl:message>
navigation-link-list applied <xsl:value-of select="'navigation-links template called with these parameters:'"/>
</xsl:message>
<xsl:message>
<xsl:value-of select="concat(' navigation-id = ', $navigation-id)"/>
</xsl:message>
<xsl:message>
<xsl:value-of select="concat(' with-colorset = ', $with-colorset)"/>
</xsl:message>
<xsl:message>
<xsl:value-of select="concat(' min-level = ', $min-level)"/>
</xsl:message>
<xsl:message>
<xsl:value-of select="concat(' max-level = ', $max-level)"/>
</xsl:message>
<xsl:message>
<xsl:value-of select="concat(' current-level = ', $current-level)"/>
</xsl:message>
<xsl:message>
<xsl:value-of select="concat(' count(category)', count($current-level-tree))"/>
</xsl:message> </xsl:message>
<xsl:apply-templates> <!-- <dl>
<xsl:with-param name="navigation-id" select="$navigation-id"/>
<xsl:with-param name="with-colorset" select="$with-colorset"/>
<xsl:with-param name="min-level" select="$min-level"/>
<xsl:with-param name="max-level" select="$max-level"/>
<xsl:with-param name="show-description-text" select="$show-description-text"/>
<xsl:with-param name="current-level" select="$current-level"/>
<xsl:with-param name="current-level-tree" select="$current-level-tree"/>
<xsl:with-param name="navigation-link-layout" select="$navigation-link-layout"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="navigation-link-list//navigation-link-layout">
<xsl:param name="navigation-id"/>
<xsl:param name="with-colorset"/>
<xsl:param name="min-level"/>
<xsl:param name="max-level"/>
<xsl:param name="show-description-text"/>
<xsl:param name="current-level" select="1"/>
<xsl:param name="current-level-tree"
select="$data-tree//nav:categoryMenu[@id=$navigation-id]/nav:category/nav:category"/>
<xsl:param name="navigation-link-layout" select="."/>
<h1>applied navigation-link-list with these values:</h1>
<dl>
<dt>navigation-id</dt> <dt>navigation-id</dt>
<dd> <dd>
<xsl:value-of select="$navigation-id"/> <xsl:value-of select="$navigation-id"/>
</dd> </dd>
<dt>with-colorset</dt>
<dd>
<xsl:value-of select="$with-colorset"/>
</dd>
<dt>min-level</dt> <dt>min-level</dt>
<dd> <dd>
<xsl:value-of select="$min-level"/> <xsl:value-of select="$min-level"/>
@ -280,82 +140,122 @@
<dd> <dd>
<xsl:value-of select="$current-level"/> <xsl:value-of select="$current-level"/>
</dd> </dd>
</dl> </dl>-->
<xsl:if test="$current-level &gt;= min-level"> <xsl:choose>
<xsl:when test="($current-level &gt;= $min-level) and ($current-level &lt;= $max-level)">
<xsl:message> <xsl:apply-templates>
Processing current level categories... <xsl:with-param name="navigation-id" select="$navigation-id" tunnel="yes"/>
<xsl:with-param name="with-colorset" select="$with-colorset" tunnel="yes"/>
</xsl:message> <xsl:with-param name="min-level" select="$min-level" tunnel="yes"/>
<xsl:with-param name="max-level" select="$max-level" tunnel="yes"/>
<xsl:with-param name="show-description-text"
<xsl:apply-templates select="$current-level-tree"> select="$show-description-text"
<xsl:with-param name="with-colorset"/> tunnel="yes"/>
<xsl:with-param name="show-description-text"/> <xsl:with-param name="current-level" select="1" tunnel="yes"/>
<xsl:with-param name="navigation-link-layout" select="$navigation-link-layout"/> <xsl:with-param name="current-level-tree"
select="$current-level-tree"
tunnel="yes"/>
<xsl:with-param name="navigation-links-tree" select="." tunnel="yes"/>
</xsl:apply-templates> </xsl:apply-templates>
</xsl:if> </xsl:when>
<xsl:when test="($current-level &lt; $min-level) and $current-level-tree/nav:category">
<xsl:apply-templates select=".">
<xsl:with-param name="navigation-id" select="$navigation-id" tunnel="yes"/>
<xsl:with-param name="with-colorset" select="$with-colorset" tunnel="yes"/>
<xsl:with-param name="min-level" select="$min-level" tunnel="yes"/>
<xsl:with-param name="max-level" select="$max-level"/>
<xsl:with-param name="show-description-text"
select="$show-description-text"
tunnel="yes"/>
<xsl:with-param name="current-level" select="$current-level + 1"
tunnel="yes"/>
<xsl:with-param name="current-level-tree"
select="$current-level-tree/nav:category"
tunnel="yes"/>
<xsl:with-param name="navigation-links-tree" select="."
tunnel="yes"/>
</xsl:apply-templates>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:if test="($current-level &lt; $max-level) and $current-level-tree/nav:category"> <xsl:template match="navigation-links//navigation-link">
<xsl:param name="navigation-id" tunnel="yes"/>
<xsl:param name="with-colorset" tunnel="yes"/>
<xsl:param name="min-level" tunnel="yes"/>
<xsl:param name="max-level" tunnel="yes"/>
<xsl:param name="show-description-text" tunnel="yes"/>
<xsl:param name="current-level" tunnel="yes"/>
<xsl:param name="current-level-tree" tunnel="yes"/>
<xsl:param name="navigation-links-tree" tunnel="yes"/>
<xsl:message>Processing sub level categories</xsl:message> <xsl:variable name="link-tree" select="current()"/>
<xsl:call-template name="navigation-link-list"> <xsl:for-each select="$current-level-tree">
<xsl:apply-templates select="$link-tree/*">
<xsl:with-param name="navigation-id" select="$navigation-id" tunnel="yes"/>
<xsl:with-param name="with-colorset" select="$with-colorset" tunnel="yes"/>
<xsl:with-param name="min-level" select="$min-level" tunnel="yes"/>
<xsl:with-param name="max-level" select="$max-level" tunnel="yes"/>
<xsl:with-param name="show-description-text"
select="show-description-text"
tunnel="yes"/>
<xsl:with-param name="current-level" select="$current-level" tunnel="yes"/>
<xsl:with-param name="current-level-tree"
select="current()"
tunnel="yes"/>
<xsl:with-param name="navigation-links-tree"
select="$navigation-links-tree"
tunnel="yes"/>
<xsl:with-param name="href" select="./@url" tunnel="yes"/>
<xsl:with-param name="title" tunnel="yes">
<xsl:choose>
<xsl:when test="$show-description-text and ./@description">
<xsl:value-of select="./@description"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="./@title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
<xsl:with-param name="link-label" select="./@title" tunnel="yes"/>
</xsl:apply-templates>
</xsl:for-each>
</xsl:template>
<xsl:template match="navigation-link//navigation-link-label">
<xsl:param name="link-label" tunnel="yes"/>
<xsl:value-of select="$link-label"/>
</xsl:template>
<xsl:template match="navigation-link//navigation-sublinks">
<xsl:param name="navigation-id" tunnel="yes"/>
<xsl:param name="with-colorset" tunnel="yes"/>
<xsl:param name="min-level" tunnel="yes"/>
<xsl:param name="max-level" tunnel="yes"/>
<xsl:param name="show-description-text" tunnel="yes"/>
<xsl:param name="current-level" tunnel="yes"/>
<xsl:param name="current-level-tree" tunnel="yes"/>
<xsl:param name="navigation-links-tree" tunnel="yes"/>
<xsl:if test="($current-level &lt;= $max-level) and $current-level-tree/nav:category">
<xsl:apply-templates select="$navigation-links-tree">
<xsl:with-param name="navigation-id" select="$navigation-id"/> <xsl:with-param name="navigation-id" select="$navigation-id"/>
<xsl:with-param name="with-colorset" select="$with-colorset"/> <xsl:with-param name="with-colorset" select="$with-colorset"/>
<xsl:with-param name="min-level" select="$min-level"/> <xsl:with-param name="min-level" select="$min-level"/>
<xsl:with-param name="max-level" select="$max-level"/> <xsl:with-param name="max-level" select="$max-level"/>
<xsl:with-param name="show-description-text" select="$show-description-text"/> <xsl:with-param name="show-description-text" select="$show-description-text"/>
<xsl:with-param name="current-level" select="$current-level + 1"/> <xsl:with-param name="current-level" select="$current-level + 1"/>
<xsl:with-param name="current-level-tree" select="$current-level-tree/nav:category"/> <xsl:with-param name="current-level-tree"
<xsl:with-param name="navigation-link-layout" select="$navigation-link-layout"/> select="$current-level-tree/nav:category"
</xsl:call-template> tunnel="yes"/>
<xsl:with-param name="navigation-links-tree" select="$navigation-links-tree"/>
</xsl:apply-templates>
</xsl:if> </xsl:if>
</xsl:template> </xsl:template>
<xsl:template match="nav:category">
<xsl:param name="with-colorset"/>
<xsl:param name="show-description-text"/>
<xsl:param name="navigation-link-layout"/>
<xsl:message>nav:category applied</xsl:message>
<xsl:apply-templates select="$navigation-link-layout">
<xsl:with-param name="url" select="./@url"/>
<xsl:with-param name="title" select="./@title"/>
<xsl:with-param name="description" select="./@description"/>
<xsl:with-param name="with-colorset" select="$with-colorset"/>
<xsl:with-param name="show-description-text" select="$show-description-text"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="navigation-link">
<xsl:param name="url"/>
<xsl:param name="title"/>
<xsl:param name="description"/>
<xsl:param name="with-colorset"/>
<xsl:param name="show-description-text"/>
<xsl:message>navigation-link applied</xsl:message>
<a href="{$url}">
<xsl:attribute name="title">
<xsl:choose>
<xsl:when test="$show-description-text = 'true'">
<xsl:value-of select="$description"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:value-of select="$title"/>
</a>
</xsl:template>-->
</xsl:stylesheet> </xsl:stylesheet>

View File

@ -7,7 +7,7 @@
xmlns:foundry="http://foundry.libreccm.org" xmlns:foundry="http://foundry.libreccm.org"
xmlns:ui="http://www.arsdigita.com/ui/1.0" xmlns:ui="http://www.arsdigita.com/ui/1.0"
exclude-result-prefixes="xsl bebop cms foundry ui" exclude-result-prefixes="xsl bebop cms foundry ui"
version="1.0"> version="2.0">
<xsl:template match="subsite-name"> <xsl:template match="subsite-name">
<xsl:variable name="subsite-banner-text"> <xsl:variable name="subsite-banner-text">

View File

@ -26,10 +26,10 @@
EXSLT functions. EXSLT functions.
--> -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:bebop="http://www.arsdigita.com/bebop/1.0" xmlns:bebop="http://www.arsdigita.com/bebop/1.0"
xmlns:cms="http://www.arsdigita.com/cms/1.0" xmlns:cms="http://www.arsdigita.com/cms/1.0"
xmlns:foundry="http://foundry.libreccm.org" xmlns:foundry="http://foundry.libreccm.org"
xmlns:func="http://exslt.org/functions"
xmlns:nav="http://ccm.redhat.com/navigation" xmlns:nav="http://ccm.redhat.com/navigation"
version="1.0"> version="1.0">
@ -99,8 +99,8 @@ EXSLT functions.
</p> </p>
</foundry:doc-desc> </foundry:doc-desc>
</foundry:doc> </foundry:doc>
<func:function name="foundry:boolean"> <xsl:function name="foundry:boolean" as="xs:boolean">
<xsl:param name="value"/> <xsl:param name="value" as="xs:string"/>
<xsl:choose> <xsl:choose>
<xsl:when test="$value = 'true' <xsl:when test="$value = 'true'
or $value = 'TRUE' or $value = 'TRUE'
@ -110,14 +110,14 @@ EXSLT functions.
or $value = 'T' or $value = 'T'
or $value = 'y' or $value = 'y'
or $value = 'Y'"> or $value = 'Y'">
<func:result select="true()"/> <xsl:sequence select="true()"/>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<func:result select="false()"/> <xsl:sequence select="false()"/>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</func:function> </xsl:function>
<foundry:doc section="devel"> <foundry:doc section="devel">
<foundry:doc-param name="level" <foundry:doc-param name="level"
@ -147,14 +147,12 @@ EXSLT functions.
#foundry-message-error #foundry-message-error
</foundry:doc-see-also> </foundry:doc-see-also>
</foundry:doc> </foundry:doc>
<func:function name="foundry:message"> <xsl:function name="foundry:message" as="xs:string">
<xsl:param name="level"/> <xsl:param name="level" as="xs:string"/>
<xsl:param name="message"/> <xsl:param name="message" as="xs:string"/>
<func:result> <xsl:sequence select="concat('[Foundry ', $level, '] ', $message)"/>
<xsl:value-of select="concat('[Foundry ', $level, '] ', $message)"/> </xsl:function>
</func:result>
</func:function>
<foundry:doc section="devel"> <foundry:doc section="devel">
<foundry:doc-param name="message" <foundry:doc-param name="message"
@ -180,13 +178,11 @@ EXSLT functions.
#foundry-message-error #foundry-message-error
</foundry:doc-see-also> </foundry:doc-see-also>
</foundry:doc> </foundry:doc>
<func:function name="foundry:message-info"> <xsl:function name="foundry:message-info" as="xs:string">
<xsl:param name="message"/> <xsl:param name="message" as="xs:string"/>
<func:result> <xsl:sequence select="foundry:message('INFO', $message)"/>
<xsl:value-of select="foundry:message('INFO', $message)"/> </xsl:function>
</func:result>
</func:function>
<foundry:doc section="devel"> <foundry:doc section="devel">
<foundry:doc-param name="message" <foundry:doc-param name="message"
@ -214,13 +210,11 @@ EXSLT functions.
#foundry-message-error #foundry-message-error
</foundry:doc-see-also> </foundry:doc-see-also>
</foundry:doc> </foundry:doc>
<func:function name="foundry:message-warn"> <xsl:function name="foundry:message-warn" as="xs:string">
<xsl:param name="message"/> <xsl:param name="message" as="xs:string"/>
<func:result> <xsl:sequence select="foundry:message('WARNING', $message)"/>
<xsl:value-of select="foundry:message('WARNING', $message)"/> </xsl:function>
</func:result>
</func:function>
<foundry:doc section="devel"> <foundry:doc section="devel">
<foundry:doc-param name="message" <foundry:doc-param name="message"
@ -248,20 +242,20 @@ EXSLT functions.
#foundry-message-warn #foundry-message-warn
</foundry:doc-see-also> </foundry:doc-see-also>
</foundry:doc> </foundry:doc>
<func:function name="foundry:message-error"> <xsl:function name="foundry:message-error" as="xs:string">
<xsl:param name="message"/> <xsl:param name="message" as="xs:string"/>
<func:result>
<xsl:value-of select="foundry:message('ERROR', $message)"/> <xsl:sequence select="foundry:message('ERROR', $message)"/>
</func:result> </xsl:function>
</func:function>
<foundry:doc section="devel"> <foundry:doc section="devel">
<foundry:doc-param name="attribute-name" <foundry:doc-param name="node">
mandatory="yes"> The node from which the value of the attribute is read.
</foundry:doc-param>
<foundry:doc-param name="attribute-name">
The attribute to check for. The attribute to check for.
</foundry:doc-param> </foundry:doc-param>
<foundry:doc-param name="default-value" <foundry:doc-param name="default-value">
mandatory="yes">
The default value if the attribute is not set. The default value if the attribute is not set.
</foundry:doc-param> </foundry:doc-param>
<foundry:doc-result> <foundry:doc-result>
@ -278,9 +272,9 @@ EXSLT functions.
<pre> <pre>
&lt;xsl:template match="example"&gt; &lt;xsl:template match="example"&gt;
&lt;xsl:variable name="width" &lt;xsl:variable name="width"
select="foundry:get-attribute-value('width', '640')" /&gt; select="foundry:get-attribute-value(current(), 'width', '640')" /&gt;
&lt;xsl:variable name="height" &lt;xsl:variable name="height"
select="foundry:get-attribute-value('height', '480')" /&gt; select="foundry:get-attribute-value(current(), 'height', '480')" /&gt;
/&lt;xsl:template&gt; /&lt;xsl:template&gt;
</pre> </pre>
<p> <p>
@ -293,21 +287,36 @@ EXSLT functions.
</p> </p>
</foundry:doc-desc> </foundry:doc-desc>
</foundry:doc> </foundry:doc>
<func:function name="foundry:get-attribute-value"> <xsl:function name="foundry:get-attribute-value">
<xsl:param name="node"/>
<xsl:param name="attribute-name"/> <xsl:param name="attribute-name"/>
<xsl:param name="default-value"/> <xsl:param name="default-value"/>
<func:result>
<xsl:choose> <xsl:choose>
<xsl:when test="./@*[name() = $attribute-name]"> <xsl:when test="$node/@*[name() = $attribute-name]">
<xsl:value-of select="./@*[name() = $attribute-name]"/> <xsl:sequence select="$node/@*[name() = $attribute-name]"/>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:value-of select="$default-value"/> <xsl:sequence select="$default-value"/>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</func:result>
</func:function> </xsl:function>
<xsl:function name="foundry:get-setting" as="xs:string">
<xsl:param name="module" as="xs:string"/>
<xsl:param name="setting" as="xs:string"/>
<xsl:sequence select="foundry:get-setting($module, $setting, '', '')"/>
</xsl:function>
<xsl:function name="foundry:get-setting" as="xs:string">
<xsl:param name="module" as="xs:string"/>
<xsl:param name="setting" as="xs:string"/>
<xsl:param name="default" as="xs:string"/>
<xsl:sequence select="foundry:get-setting($module, $setting, $default, '')"/>
</xsl:function>
<foundry:doc section="devel"> <foundry:doc section="devel">
<foundry:doc-param name="module" <foundry:doc-param name="module"
@ -341,44 +350,59 @@ EXSLT functions.
value. If no default value has been provided the result is an empty string. value. If no default value has been provided the result is an empty string.
</foundry:doc-result> </foundry:doc-result>
<foundry:doc-desc> <foundry:doc-desc>
This EXSLT function retrieves the value of a setting from the theme configuration. For This function retrieves the value of a setting from the theme configuration. For
more informations about the configuration system of Foundry please refer to the more informations about the configuration system of Foundry please refer to the
<em>configuration</em> section of the Foundry documentation. <em>configuration</em> section of the Foundry documentation.
</foundry:doc-desc> </foundry:doc-desc>
</foundry:doc> </foundry:doc>
<func:function name="foundry:get-setting"> <xsl:function name="foundry:get-setting" as="xs:string">
<xsl:param name="module"/> <xsl:param name="module" as="xs:string"/>
<xsl:param name="setting"/> <xsl:param name="setting" as="xs:string"/>
<xsl:param name="default" select="''"/> <xsl:param name="default" as="xs:string"/>
<xsl:param name="node"/> <xsl:param name="node"/>
<xsl:choose> <xsl:choose>
<xsl:when test="$node and $node != ''"> <xsl:when test="$node and $node != ''">
<func:result select="$node"/> <xsl:sequence select="$node"/>
</xsl:when> </xsl:when>
<xsl:when test="$module = ''"> <xsl:when test="$module = ''">
<func:result select="document(concat($theme-prefix, '/conf/global.xml'))/foundry:configuration/setting[@id=$setting]"/> <xsl:sequence select="document(concat($theme-prefix, '/conf/global.xml'))/foundry:configuration/setting[@id=$setting]"/>
</xsl:when> </xsl:when>
<xsl:when test="not($module = '') and document(concat($theme-prefix, '/conf/', $module, '.xml'))/foundry:configuration/setting[@id=$setting]"> <xsl:when test="not($module = '') and document(concat($theme-prefix, '/conf/', $module, '.xml'))/foundry:configuration/setting[@id=$setting]">
<func:result select="document(concat($theme-prefix, '/conf/', $module, '.xml'))/foundry:configuration/setting[@id=$setting]"/> <xsl:sequence select="document(concat($theme-prefix, '/conf/', $module, '.xml'))/foundry:configuration/setting[@id=$setting]"/>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:message> <xsl:message>
<xsl:choose> <xsl:choose>
<xsl:when test="$module=''"> <xsl:when test="$module=''">
<xsl:value-of select="foundry:message-warn(concat('Setting &quot;', $setting, '&quot; not found in global.xml'))"/> <xsl:sequence select="foundry:message-warn(concat('Setting &quot;', $setting, '&quot; not found in global.xml'))"/>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:value-of select="foundry:message-warn(concat('Setting &quot;', $setting, '&quot; not found in', $module, '.xml'))"/> <xsl:sequence select="foundry:message-warn(concat('Setting &quot;', $setting, '&quot; not found in', $module, '.xml'))"/>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:message> </xsl:message>
<func:result select="$default"/> <xsl:sequence select="$default"/>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</func:function> </xsl:function>
<xsl:function name="foundry:get-static-text" as="xs:string">
<xsl:param name="module" as="xs:string"/>
<xsl:param name="id" as="xs:string"/>
<xsl:sequence select="foundry:get-static-text($module, $id, true(), $lang)"/>
</xsl:function>
<xsl:function name="foundry:get-static-text" as="xs:string">
<xsl:param name="module" as="xs:string"/>
<xsl:param name="id" as="xs:string"/>
<xsl:param name="html" as="xs:boolean"/>
<xsl:sequence select="foundry:get-static-text($module, $id, $html, $lang)"/>
</xsl:function>
<foundry:doc section="devel"> <foundry:doc section="devel">
<foundry:doc-param name="module" <foundry:doc-param name="module"
@ -413,50 +437,49 @@ EXSLT functions.
refer to the static texts section in the Foundry documentation. refer to the static texts section in the Foundry documentation.
</foundry:doc-desc> </foundry:doc-desc>
</foundry:doc> </foundry:doc>
<func:function name="foundry:get-static-text"> <xsl:function name="foundry:get-static-text" as="xs:string">
<xsl:param name="module"/> <xsl:param name="module" as="xs:string"/>
<xsl:param name="id"/> <xsl:param name="id" as="xs:string"/>
<xsl:param name="html" select="'true'"/> <xsl:param name="html" as="xs:boolean"/>
<xsl:param name="lang" select="$lang"/> <xsl:param name="lang" as="xs:string"/>
<func:result>
<xsl:choose> <xsl:choose>
<xsl:when test="$module = '' and document(concat($theme-prefix, '/texts/global.xml'))/foundry:static-texts/text[@id=$id]/translation[@lang = $lang]"> <xsl:when test="$module = '' and document(concat($theme-prefix, '/texts/global.xml'))/foundry:static-texts/text[@id=$id]/translation[@lang = $lang]">
<xsl:value-of select="document(concat($theme-prefix, '/texts/global.xml'))/foundry:static-texts/text[@id=$id]"/> <xsl:sequence select="document(concat($theme-prefix, '/texts/global.xml'))/foundry:static-texts/text[@id=$id]"/>
</xsl:when> </xsl:when>
<xsl:when test="not($module = '') and document(concat($theme-prefix, '/texts/', $module, '.xml'))/foundry:static-texts/text[@id=$id]/translation[@lang = $lang]"> <xsl:when test="not($module = '') and document(concat($theme-prefix, '/texts/', $module, '.xml'))/foundry:static-texts/text[@id=$id]/translation[@lang = $lang]">
<xsl:value-of select="document(concat($theme-prefix, '/texts/', $module, '.xml'))/foundry:static-texts/text[@id=$id]/translation[@lang = $lang]"/> <xsl:sequence select="document(concat($theme-prefix, '/texts/', $module, '.xml'))/foundry:static-texts/text[@id=$id]/translation[@lang = $lang]"/>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:choose> <xsl:choose>
<xsl:when test="foundry:debug-enabled()"> <xsl:when test="foundry:debug-enabled()">
<xsl:choose> <xsl:choose>
<xsl:when test="$html = 'true'"> <xsl:when test="$html">
<span class="foundry-debug-missing-translation"> <span class="foundry-debug-missing-translation">
<span class="foundry-placeholder"> <span class="foundry-placeholder">
<xsl:value-of select="$id"/> <xsl:sequence select="$id"/>
</span> </span>
<span class="foundry-missing-translation-path"> <span class="foundry-missing-translation-path">
<xsl:choose> <xsl:choose>
<xsl:when test="$module = ''"> <xsl:when test="$module = ''">
<xsl:value-of select="document(concat($theme-prefix, '/texts/global.xml'))/foundry:static-texts/text[@id=$id]/translation[@lang=$lang]"/> <xsl:sequence select="document(concat($theme-prefix, '/texts/global.xml'))/foundry:static-texts/text[@id=$id]/translation[@lang=$lang]"/>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:value-of select="document(concat($theme-prefix, '/texts/', $module, '.xml'))/foundry:static-texts/text[@id=$id]/translation[@lang=$lang]"/> <xsl:sequence select="document(concat($theme-prefix, '/texts/', $module, '.xml'))/foundry:static-texts/text[@id=$id]/translation[@lang=$lang]"/>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</span> </span>
</span> </span>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:value-of select="$id"/> <xsl:sequence select="$id"/>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:when> </xsl:when>
</xsl:choose> </xsl:choose>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</func:result> </xsl:function>
</func:function>
<foundry:doc section="devel"> <foundry:doc section="devel">
<foundry:doc-result> <foundry:doc-result>
@ -467,16 +490,16 @@ EXSLT functions.
of foundry is automatically enabled if the theme is viewed as development theme. of foundry is automatically enabled if the theme is viewed as development theme.
</foundry:doc-desc> </foundry:doc-desc>
</foundry:doc> </foundry:doc>
<func:function name="foundry:debug-enabled"> <xsl:function name="foundry:debug-enabled" as="xs:boolean">
<xsl:choose> <xsl:choose>
<xsl:when test="contains($theme-prefix, 'devel-themedir')"> <xsl:when test="contains($theme-prefix, 'devel-themedir')">
<func:result select="true()"/> <xsl:sequence select="true()"/>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<func:result select="false()"/> <xsl:sequence select="false()"/>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</func:function> </xsl:function>
<foundry:doc section="devel"> <foundry:doc section="devel">
<foundry:doc-desc> <foundry:doc-desc>
@ -491,58 +514,65 @@ EXSLT functions.
and (name() != 'hint') and (name() != 'hint')
and (name() != 'label')"> and (name() != 'label')">
<xsl:attribute name="{name()}"> <xsl:attribute name="{name()}">
<xsl:value-of select="."/> <xsl:sequence select="."/>
</xsl:attribute> </xsl:attribute>
</xsl:if> </xsl:if>
</xsl:for-each> </xsl:for-each>
<xsl:if test="name() = 'bebop:formWidget' and (not(@id) and @name)"> <xsl:if test="name() = 'bebop:formWidget' and (not(@id) and @name)">
<xsl:attribute name="id"> <xsl:attribute name="id">
<xsl:value-of select="@name"/> <xsl:sequence select="@name"/>
</xsl:attribute> </xsl:attribute>
</xsl:if> </xsl:if>
</xsl:template> </xsl:template>
<func:function name="foundry:shying"> <xsl:function name="foundry:shying" as="xs:string">
<xsl:param name="text"/> <xsl:param name="text" as="xs:string"/>
<func:result select="translate($text, '\-', '&shy;')"/>
</func:function> <xsl:message>
<xsl:sequence select="concat('foundry:shying called with ', $text)"/>
</xsl:message>
<xsl:message>
<xsl:sequence select="concat('Result: ', translate($text, '\-', '&shy;'))"/>
</xsl:message>
<xsl:sequence select="translate($text, '\-', '&shy;')"/>
</xsl:function>
<func:function name="foundry:title"> <xsl:function name="foundry:title" as="xs:string">
<func:result>
<xsl:choose> <xsl:choose>
<!-- Use fixed title for some special content items --> <!-- Use fixed title for some special content items -->
<xsl:when test="$data-tree//cms:contentPanel"> <xsl:when test="$data-tree//cms:contentPanel">
<xsl:choose> <xsl:choose>
<!-- Glossary --> <!-- Glossary -->
<xsl:when test="$data-tree//cms:contentPanel/cms:item/type/label = 'Glossary Item'"> <xsl:when test="$data-tree//cms:contentPanel/cms:item/type/label = 'Glossary Item'">
<xsl:value-of select="foundry:get-static-text('layout/page/title/glossary')"/> <xsl:sequence select="foundry:get-static-text('layout/page/title/glossary')"/>
</xsl:when> </xsl:when>
<!-- FAQ --> <!-- FAQ -->
<xsl:when test="$data-tree//cms:contentPanel/cms:item/type/label = 'FAQ Item'"> <xsl:when test="$data-tree//cms:contentPanel/cms:item/type/label = 'FAQ Item'">
<xsl:value-of select="foundry:get-static-text('layout/page/title/faq')"/> <xsl:sequence select="foundry:get-static-text('layout/page/title/faq')"/>
</xsl:when> </xsl:when>
<!-- Else use title of CI --> <!-- Else use title of CI -->
<xsl:otherwise> <xsl:otherwise>
<xsl:value-of select="foundry:shying($data-tree//cms:contentPanel/cms:item/title)"/> <xsl:sequence select="foundry:shying($data-tree//cms:contentPanel/cms:item/title)"/>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:when> </xsl:when>
<!-- Localized title for A-Z list --> <!-- Localized title for A-Z list -->
<xsl:when test="$data-tree/bebop:title = 'AtoZ'"> <xsl:when test="$data-tree/bebop:title = 'AtoZ'">
<xsl:value-of select="foundry:get-static-text('layout/page/title/atoz')"/> <xsl:sequence select="foundry:get-static-text('layout/page/title/atoz')"/>
</xsl:when> </xsl:when>
<!-- Localized title for search --> <!-- Localized title for search -->
<xsl:when test="$data-tree/bebop:title = 'Search'"> <xsl:when test="$data-tree/bebop:title = 'Search'">
<xsl:value-of select="foundry:get-static-text('layout/page/title/search')"/> <xsl:sequence select="foundry:get-static-text('layout/page/title/search')"/>
</xsl:when> </xsl:when>
<!-- Localized title for log in --> <!-- Localized title for log in -->
<xsl:when test="$data-tree/@application = 'login'"> <xsl:when test="$data-tree/@application = 'login'">
<xsl:value-of select="foundry:get-static-text('layout/page/title/login')"/> <xsl:sequence select="foundry:get-static-text('layout/page/title/login')"/>
</xsl:when> </xsl:when>
<!-- Localited title for sitemap --> <!-- Localited title for sitemap -->
<xsl:when test="$data-tree/@id = 'sitemapPage'"> <xsl:when test="$data-tree/@id = 'sitemapPage'">
<xsl:value-of select="foundry:get-static-text('layout/page/title/sitemap')"/> <xsl:sequence select="foundry:get-static-text('layout/page/title/sitemap')"/>
</xsl:when> </xsl:when>
<!-- Title for content section--> <!-- Title for content section-->
<xsl:otherwise> <xsl:otherwise>
@ -550,17 +580,16 @@ EXSLT functions.
<xsl:choose> <xsl:choose>
<!-- Special rule: Use content item title für root-page in navigation --> <!-- Special rule: Use content item title für root-page in navigation -->
<xsl:when test="position() = last() and position() = 1"> <xsl:when test="position() = last() and position() = 1">
<xsl:value-of select="foundry:shying(/bebop:page//title)"/> <xsl:sequence select="foundry:shying(/bebop:page//title)"/>
</xsl:when> </xsl:when>
<!-- Else use the name of the category --> <!-- Else use the name of the category -->
<xsl:when test="position() = last()"> <xsl:when test="position() = last()">
<xsl:value-of select="foundry:shying(./@title)"/> <xsl:sequence select="foundry:shying(./@title)"/>
</xsl:when> </xsl:when>
</xsl:choose> </xsl:choose>
</xsl:for-each> </xsl:for-each>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</func:result> </xsl:function>
</func:function>
</xsl:stylesheet> </xsl:stylesheet>

View File

@ -30,6 +30,7 @@
<xsl:import href="../doc/xsl/foundry-documentation.xsl"/> <xsl:import href="../doc/xsl/foundry-documentation.xsl"/>
<xsl:output method="html" <xsl:output method="html"
doctype-system="about:legacy-compat"
indent="yes" indent="yes"
encoding="utf-8"/> encoding="utf-8"/>
@ -81,8 +82,7 @@
</foundry:doc-desc> </foundry:doc-desc>
</foundry:doc> </foundry:doc>
<xsl:template match="/foundry:documentation"> <xsl:template match="/foundry:documentation">
<xsl:value-of select="'&lt;!DOCTYPE HTML&gt;'" <!--<xsl:text>&lt;!DOCTYPE HTML&gt;</xsl:text>-->
disable-output-escaping="yes" />
<html> <html>
<head> <head>
<meta http-equiv="content-type" <meta http-equiv="content-type"

View File

@ -9,7 +9,11 @@
</head> </head>
<body> <body>
<nav> <nav>
<navigation-home-link/> <navigation-home-link>
<a>
<navigation-title/>
</a>
</navigation-home-link>
<navigation> <navigation>
<div class="nav-wrapper"> <div class="nav-wrapper">
<navigation-links> <navigation-links>