1 <?xml version="1.0" encoding="utf-8"?>
3 Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
5 Distributed under the Boost Software License, Version 1.0.
6 (See accompanying file LICENSE_1_0.txt or copy at
7 http://www.boost.org/LICENSE_1_0.txt)
9 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
11 <xsl:key name="library-categories" match="library"
12 use="libraryinfo/librarycategory/@name"/>
14 <xsl:template match="librarylist">
15 <itemizedlist spacing="compact">
16 <xsl:apply-templates select="//library"
17 mode="build-library-list">
18 <xsl:sort select="@name"/>
19 </xsl:apply-templates>
23 <xsl:template name="library.link">
24 <xsl:param name="node" select="."/>
25 <xsl:param name="name" select="$node/attribute::name"/>
28 <xsl:when test="$node/attribute::html-only = 1">
29 <xsl:variable name="url">
31 <xsl:when test="$node/attribute::url">
32 <xsl:value-of select="$node/attribute::url"/>
35 <xsl:value-of select="concat($boost.root,
37 $node/attribute::dirname,
43 <xsl:attribute name="url">
44 <xsl:value-of select="$url"/>
46 <xsl:value-of select="$name"/>
50 <xsl:call-template name="internal-link">
51 <xsl:with-param name="to">
53 <xsl:when test="$node/attribute::id">
54 <xsl:value-of select="$node/attribute::id"/>
57 <xsl:call-template name="generate.id">
58 <xsl:with-param name="node" select="$node"/>
63 <xsl:with-param name="text" select="$name"/>
69 <xsl:template match="library" mode="build-library-list">
72 <xsl:call-template name="library.link"/>
73 <xsl:text> - </xsl:text>
74 <xsl:apply-templates select="libraryinfo/librarypurpose"
75 mode="build-library-list"/>
80 <xsl:template match="librarypurpose" mode="build-library-list">
81 <xsl:apply-templates/>
82 <xsl:text>, from </xsl:text>
83 <xsl:apply-templates select="../author" mode="display-author-list"/>
86 <xsl:template match="author" mode="display-author-list">
87 <xsl:if test="(position() > 1) and (count(../author) > 2)">
88 <xsl:text>, </xsl:text>
90 <xsl:if test="(position() = count(../author)) and (position() > 1)">
91 <xsl:if test="position() < 3">
92 <xsl:text> </xsl:text>
94 <xsl:text>and </xsl:text>
96 <xsl:apply-templates select="firstname/text()"/>
97 <xsl:text> </xsl:text>
98 <xsl:apply-templates select="surname/text()"/>
99 <xsl:if test="(position() = count(../author))">
100 <xsl:text>.</xsl:text>
104 <xsl:template match="librarycategorylist">
105 <xsl:apply-templates/>
108 <xsl:template match="librarycategorydef">
110 <title><xsl:apply-templates/></title>
111 <xsl:variable name="name" select="@name"/>
112 <itemizedlist spacing="compact">
113 <xsl:apply-templates select="key('library-categories', $name)"
114 mode="build-library-list">
115 <xsl:sort select="@name"/>
116 </xsl:apply-templates>
121 <xsl:template match="libraryinfo">
123 <xsl:apply-templates select="author|authorgroup/author|copyright|legalnotice"/>
127 <xsl:template match="librarypurpose|librarycategory"/>