<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<!--
// // See license.txt for license information. // // text_content.xsl // // 8-Oct-2004 phamilton Created //
-->

<xsl:stylesheet xmlns:db="http://docbook.org/ns/docbook" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="xml" indent="yes"/>
    <xsl:param name="date"/>
    <xsl:param name="folder"/>
    <xsl:param name="rootpath"/>
    <xsl:template match="files">
        <xsl:comment>
Generated by files.xsl on             <xsl:value-of select="$date"/>
. Edit at your own risk!         </xsl:comment>
        <db:book>
            <db:bookinfo>
                <db:title>
                    <xsl:value-of select="title"/>
                </db:title>
            </db:bookinfo>
            <db:chapter>
                <db:title>
List of files contained in the folder                     <xsl:value-of select="$folder"/>
                </db:title>
                <db:para> The table below displays all files contained in the folder. Clicking on a folder or a document icon on the left will take you to the contents of that folder or documentation respectively. </db:para>
                <db:table>
                    <db:thead>
                        <db:row>
                            <db:entry/>
                            <db:entry>Name</db:entry>
                            <db:entry>Description</db:entry>
                        </db:row>
                    </db:thead>
                    <db:tbody>
                        <xsl:apply-templates/>
                    </db:tbody>
                </db:table>
            </db:chapter>
        </db:book>
    </xsl:template>
    <xsl:template match="title"> </xsl:template>
    <xsl:template match="xmlliterateroot"> </xsl:template>
    <xsl:template match="boostversion"> </xsl:template>
    <xsl:template match="folder">
        <db:row>
            <db:entry>
                <xsl:choose>
                    <xsl:when test="nocontents">
                        <db:image>
                            <xsl:attribute name="url">
                                <xsl:value-of select="$rootpath"/>
                                <xsl:text>images/ftv2doc.png</xsl:text>
                            </xsl:attribute>
                        </db:image>
                    </xsl:when>
                    <xsl:otherwise>
                        <db:ulink>
                            <xsl:attribute name="url">
                                <xsl:value-of select="@name"/>
                                <xsl:text>/files.html</xsl:text>
                            </xsl:attribute>
                            <db:image>
                                <xsl:attribute name="url">
                                    <xsl:value-of select="$rootpath"/>
                                    <xsl:text>images/folder.gif</xsl:text>
                                </xsl:attribute>
                            </db:image>
                        </db:ulink>
                    </xsl:otherwise>
                </xsl:choose>
            </db:entry>
            <db:entry>
                <xsl:value-of select="@name"/>
            </db:entry>
            <db:entry>
                <xsl:choose>
                    <xsl:when test="files/title">
                        <xsl:value-of select="files/title"/>
                    </xsl:when>
                    <xsl:otherwise>
                        <xsl:value-of select="text()"/>
                    </xsl:otherwise>
                </xsl:choose>
            </db:entry>
        </db:row>
    </xsl:template>
    <xsl:template match="file">
        <db:row>
            <db:entry>
                <xsl:choose>
                    <xsl:when test="docbook">
                        <db:ulink>
                            <xsl:attribute name="url">
                                <xsl:value-of select="substring-before(docbook, '.')"/>
                                <xsl:text>.html</xsl:text>
                            </xsl:attribute>
                            <db:image>
                                <xsl:attribute name="url">
                                    <xsl:value-of select="$rootpath"/>
                                    <xsl:text>images/ftv2folderclosed.png</xsl:text>
                                </xsl:attribute>
                            </db:image>
                        </db:ulink>
                    </xsl:when>
                    <xsl:otherwise>
                        <db:image>
                            <xsl:attribute name="url">
                                <xsl:value-of select="$rootpath"/>
                                <xsl:text>images/ftv2doc.png</xsl:text>
                            </xsl:attribute>
                        </db:image>
                    </xsl:otherwise>
                </xsl:choose>
            </db:entry>
            <db:entry>
                <xsl:choose>
                    <xsl:when test="contains(@name, '.xml') or contains(@name, '.xsl')">
                        <db:ulink>
                            <xsl:attribute name="url">
                                <xsl:value-of select="substring-before(@name, '.')"/>
                                <xsl:text>_xml.html</xsl:text>
                            </xsl:attribute>
                            <xsl:value-of select="@name"/>
                        </db:ulink>
                    </xsl:when>
                    <xsl:otherwise>
                        <xsl:value-of select="@name"/>
                    </xsl:otherwise>
                </xsl:choose>
            </db:entry>
            <db:entry>
                <xsl:value-of select="text()"/>
            </db:entry>
        </db:row>
    </xsl:template>
    <xsl:template match="schema">
        <db:row>
            <db:entry>
                <db:ulink url="index.html">
                    <db:image>
                        <xsl:attribute name="url">
                            <xsl:value-of select="$rootpath"/>
                            <xsl:text>images/ftv2folderclosed.png</xsl:text>
                        </xsl:attribute>
                    </db:image>
                </db:ulink>
            </db:entry>
            <db:entry>
                <xsl:choose>
                    <xsl:when test="contains(@name, '.xml') or contains(@name, '.xsl')">
                        <db:ulink>
                            <xsl:attribute name="url">
                                <xsl:value-of select="substring-before(@name, '.')"/>
                                <xsl:text>_xml.html</xsl:text>
                            </xsl:attribute>
                            <xsl:value-of select="@name"/>
                        </db:ulink>
                    </xsl:when>
                    <xsl:otherwise>
                        <xsl:value-of select="@name"/>
                    </xsl:otherwise>
                </xsl:choose>
            </db:entry>
            <db:entry>
                <xsl:value-of select="text()"/>
            </db:entry>
        </db:row>
    </xsl:template>
</xsl:stylesheet>