Corrected XSL toc
This commit is contained in:
parent
30f8f71d34
commit
da1eac6c97
@ -10,9 +10,11 @@ function printSlogan() {}
|
||||
function printContent() {
|
||||
global $root;
|
||||
?>
|
||||
<p>
|
||||
<a href="../">Manual</a> : <a href="">Advanced topics</a>
|
||||
</p>
|
||||
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
||||
<tr>
|
||||
<td class="right"><a href="<?=$root?>/manual/">Manual</a> : <a href="<?=$root?>/manual/Advanced/">Advanced topics</a></td><td class="left"><a href="<?=$root?>/manual/Advanced/">previous</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
@ -10,9 +10,11 @@ function printSlogan() {}
|
||||
function printContent() {
|
||||
global $root;
|
||||
?>
|
||||
<p>
|
||||
<a href="../">Manual</a> : <a href="">DSL support</a>
|
||||
</p>
|
||||
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
||||
<tr>
|
||||
<td class="right"><a href="<?=$root?>/manual/">Manual</a> : <a href="<?=$root?>/manual/DSL/">DSL support</a></td><td class="left"><a href="<?=$root?>/manual/DSL/">previous</a> : <a href="<?=$root?>/manual/DSL/">next</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
@ -10,9 +10,11 @@ function printSlogan() {}
|
||||
function printContent() {
|
||||
global $root;
|
||||
?>
|
||||
<p>
|
||||
<a href="../../">Manual</a> : <a href="../">jOOQ classes and their use</a> : <a href="">The example database</a>
|
||||
</p><p>
|
||||
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
||||
<tr>
|
||||
<td class="right"><a href="<?=$root?>/manual/">Manual</a> : <a href="<?=$root?>/manual/JOOQ/">jOOQ classes and their use</a> : <a href="<?=$root?>/manual/JOOQ/ExampleDatabase/">The example database</a></td><td class="left"><a href="<?=$root?>/manual/JOOQ/ExampleDatabase/">next</a></td>
|
||||
</tr>
|
||||
</table><p>
|
||||
For the examples in this manual, the same database will always be
|
||||
referred to. It essentially contains of these entities (for
|
||||
example in the Oracle dialect):
|
||||
|
||||
@ -10,9 +10,11 @@ function printSlogan() {}
|
||||
function printContent() {
|
||||
global $root;
|
||||
?>
|
||||
<p>
|
||||
<a href="../../">Manual</a> : <a href="../">jOOQ classes and their use</a> : <a href="">The factory class</a>
|
||||
</p>
|
||||
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
||||
<tr>
|
||||
<td class="right"><a href="<?=$root?>/manual/">Manual</a> : <a href="<?=$root?>/manual/JOOQ/">jOOQ classes and their use</a> : <a href="<?=$root?>/manual/JOOQ/Factory/">The factory class</a></td><td class="left"><a href="<?=$root?>/manual/JOOQ/Factory/">previous</a> : <a href="<?=$root?>/manual/JOOQ/Factory/">next</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
@ -10,9 +10,11 @@ function printSlogan() {}
|
||||
function printContent() {
|
||||
global $root;
|
||||
?>
|
||||
<p>
|
||||
<a href="../">Manual</a> : <a href="">jOOQ classes and their use</a>
|
||||
</p><p>
|
||||
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
||||
<tr>
|
||||
<td class="right"><a href="<?=$root?>/manual/">Manual</a> : <a href="<?=$root?>/manual/JOOQ/">jOOQ classes and their use</a></td><td class="left"><a href="<?=$root?>/manual/JOOQ/">next</a></td>
|
||||
</tr>
|
||||
</table><p>
|
||||
In this section, you will learn about how to use jOOQ object
|
||||
factories and the jOOQ object oriented query model, to express
|
||||
your
|
||||
@ -35,10 +37,10 @@ function printContent() {
|
||||
the way you're used to in SQL
|
||||
</p><ol>
|
||||
<li>
|
||||
<a href="<?=$root?>/JOOQ/ExampleDatabase" title="The example database">The example database</a>
|
||||
<a href="<?=$root?>/manual/JOOQ/ExampleDatabase/" title="The example database">The example database</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?=$root?>/JOOQ/Factory" title="The factory class">The factory class</a>
|
||||
<a href="<?=$root?>/manual/JOOQ/Factory/" title="The factory class">The factory class</a>
|
||||
</li>
|
||||
</ol>
|
||||
<?php
|
||||
|
||||
@ -10,9 +10,11 @@ function printSlogan() {}
|
||||
function printContent() {
|
||||
global $root;
|
||||
?>
|
||||
<p>
|
||||
<a href="../">Manual</a> : <a href="">Meta model source code generation</a>
|
||||
</p>
|
||||
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
||||
<tr>
|
||||
<td class="right"><a href="<?=$root?>/manual/">Manual</a> : <a href="<?=$root?>/manual/META/">Meta model source code generation</a></td><td class="left"><a href="<?=$root?>/manual/META/">previous</a> : <a href="<?=$root?>/manual/META/">next</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
@ -10,28 +10,30 @@ function printSlogan() {}
|
||||
function printContent() {
|
||||
global $root;
|
||||
?>
|
||||
<p>
|
||||
<a href="">Manual</a>
|
||||
</p><ol>
|
||||
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
||||
<tr>
|
||||
<td class="right"><a href="<?=$root?>/manual/">Manual</a></td><td class="left"></td>
|
||||
</tr>
|
||||
</table><ol>
|
||||
<li>
|
||||
<a href="<?=$root?>/manual/JOOQ" title="jOOQ classes and their use">jOOQ classes and their use</a>
|
||||
<a href="<?=$root?>/manual/JOOQ/" title="jOOQ classes and their use">jOOQ classes and their use</a>
|
||||
<ol>
|
||||
<li>
|
||||
<a href="<?=$root?>/manual/JOOQ/ExampleDatabase" title="The example database">The example database</a>
|
||||
<a href="<?=$root?>/manual/JOOQ/ExampleDatabase/" title="The example database">The example database</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?=$root?>/manual/JOOQ/Factory" title="The factory class">The factory class</a>
|
||||
<a href="<?=$root?>/manual/JOOQ/Factory/" title="The factory class">The factory class</a>
|
||||
</li>
|
||||
</ol>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?=$root?>/manual/META" title="Meta model source code generation">Meta model source code generation</a>
|
||||
<a href="<?=$root?>/manual/META/" title="Meta model source code generation">Meta model source code generation</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?=$root?>/manual/DSL" title="DSL support">DSL support</a>
|
||||
<a href="<?=$root?>/manual/DSL/" title="DSL support">DSL support</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?=$root?>/manual/Advanced" title="Advanced topics">Advanced topics</a>
|
||||
<a href="<?=$root?>/manual/Advanced/" title="Advanced topics">Advanced topics</a>
|
||||
</li>
|
||||
</ol>
|
||||
<?php
|
||||
|
||||
@ -7,6 +7,8 @@
|
||||
<xsl:param name="sectionID"/>
|
||||
<xsl:param name="relativePath"/>
|
||||
|
||||
<!-- Main match -->
|
||||
|
||||
<xsl:template match="/">
|
||||
<xsl:text disable-output-escaping="yes">
|
||||
<?php
|
||||
@ -33,14 +35,23 @@ function printContent() {
|
||||
</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<!-- matching templates -->
|
||||
|
||||
<xsl:template match="//section[@id = $sectionID]" mode="title">
|
||||
<xsl:value-of select="title"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="//section[@id = $sectionID]" mode="content">
|
||||
<p>
|
||||
<xsl:apply-templates select="." mode="breadcrumb"/>
|
||||
</p>
|
||||
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
||||
<tr>
|
||||
<td class="right">
|
||||
<xsl:apply-templates select="." mode="breadcrumb"/>
|
||||
</td>
|
||||
<td class="left">
|
||||
<xsl:apply-templates select="." mode="prev-next"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
<xsl:apply-templates select="content"/>
|
||||
@ -48,38 +59,68 @@ function printContent() {
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="section" mode="breadcrumb">
|
||||
<xsl:param name="href"/>
|
||||
|
||||
<xsl:if test="name(../..) = 'section'">
|
||||
<xsl:apply-templates select="../.." mode="breadcrumb">
|
||||
<xsl:with-param name="href">
|
||||
<xsl:text>../</xsl:text>
|
||||
<xsl:value-of select="$href"/>
|
||||
</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
|
||||
<xsl:apply-templates select="../.." mode="breadcrumb"/>
|
||||
<xsl:text> : </xsl:text>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:variable name="href">
|
||||
<xsl:apply-templates select="." mode="href"/>
|
||||
</xsl:variable>
|
||||
|
||||
<a href="{$href}">
|
||||
<xsl:value-of select="title"/>
|
||||
</a>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="section" mode="toc">
|
||||
<xsl:param name="path" select="@id"/>
|
||||
<xsl:template match="section" mode="href">
|
||||
<xsl:choose>
|
||||
<xsl:when test="name(../..) = 'section'">
|
||||
<xsl:apply-templates select="../.." mode="href"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:text><?=$root?>/</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<xsl:value-of select="@id"/>
|
||||
<xsl:text>/</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="section" mode="prev-next">
|
||||
<xsl:variable name="prev" select="preceding::section"/>
|
||||
<xsl:variable name="next" select="following::section"/>
|
||||
<xsl:variable name="href">
|
||||
<xsl:apply-templates select="." mode="href"/>
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:if test="$prev">
|
||||
<a href="{$href}">previous</a>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:if test="$prev and $next">
|
||||
<xsl:text> : </xsl:text>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:if test="$next">
|
||||
<a href="{$href}">next</a>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="section" mode="toc">
|
||||
<xsl:if test="toc and count(sections/section) > 0">
|
||||
<ol>
|
||||
<xsl:for-each select="sections/section">
|
||||
<li>
|
||||
<a href="<?=$root?>/{$path}/{@id}" title="{title}">
|
||||
<xsl:variable name="href">
|
||||
<xsl:apply-templates select="." mode="href"/>
|
||||
</xsl:variable>
|
||||
|
||||
<a href="{$href}" title="{title}">
|
||||
<xsl:value-of select="title"/>
|
||||
</a>
|
||||
|
||||
<xsl:apply-templates select="." mode="toc">
|
||||
<xsl:with-param name="path" select="concat($path, '/', @id)"/>
|
||||
</xsl:apply-templates>
|
||||
<xsl:apply-templates select="." mode="toc"/>
|
||||
</li>
|
||||
</xsl:for-each>
|
||||
</ol>
|
||||
@ -89,4 +130,5 @@ function printContent() {
|
||||
<xsl:template match="content">
|
||||
<xsl:copy-of select="*"/>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
Loading…
Reference in New Issue
Block a user