source: stylesheets/lfs-xsl/docbook-xsl-1.78.1/assembly/topic-maker.xsl@ 111bb20

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 12.2-rc1 7.6 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 111bb20 was 15c7d39, checked in by Matthew Burgess <matthew@…>, 11 years ago

Update stylesheets to docbook-xsl-1.78.1.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@10355 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 2.7 KB
Line 
1<?xml version="1.0" encoding="utf-8"?>
2<xsl:stylesheet
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 xmlns:exsl="http://exslt.org/common"
5 xmlns="http://docbook.org/ns/docbook"
6 exclude-result-prefixes="exsl"
7 version="1.0">
8
9<!-- $Id: topic-maker.xsl,v 1.3 2012-04-16 00:29:35 bobs Exp $ -->
10
11<!-- This stylesheet convert DocBook elements into topic element.
12 The chunking takes place elsewhere. -->
13
14<xsl:import href="../xhtml/docbook.xsl"/>
15
16
17<xsl:param name="assembly.filename">myassembly.xml</xsl:param>
18<xsl:param name="chunk.section.depth" select="3"/>
19<xsl:param name="chunk.first.sections" select="1"/>
20<xsl:param name="use.id.as.filename" select="1"/>
21<xsl:param name="html.ext">.xml</xsl:param>
22<xsl:param name="base.dir">topics/</xsl:param>
23<xsl:param name="root.filename" select="local-name(/*)"/>
24<xsl:param name="html.extra.head.links" select="0"/>
25<xsl:param name="stylesheet.result.type">xhtml</xsl:param>
26<xsl:param name="navig.showtitles" select="0"/>
27<xsl:param name="suppress.navigation" select="1"/>
28<xsl:param name="chunk.append"/>
29<xsl:param name="chunk.quietly" select="0"/>
30<xsl:param name="chunker.output.method" select="'xml'"/>
31<xsl:param name="chunker.output.encoding" select="'UTF-8'"/>
32<xsl:param name="chunker.output.indent" select="'no'"/>
33<xsl:param name="chunker.output.omit-xml-declaration" select="'no'"/>
34<xsl:param name="chunker.output.standalone" select="'no'"/>
35<xsl:param name="chunker.output.doctype-public" select="''"/>
36<xsl:param name="chunker.output.doctype-system" select="''"/>
37<xsl:param name="namespace">http://docbook.org/ns/docbook</xsl:param>
38
39<!-- These elements are converted to topic elements -->
40<xsl:param name="topic.elements">preface chapter article section</xsl:param>
41<xsl:variable name="topic.list"
42 select="concat(' ', normalize-space($topic.elements), ' ')"/>
43
44<!-- Default behavior is identity copy -->
45<xsl:template match="node()|@*">
46 <xsl:copy>
47 <xsl:apply-templates select="@*"/>
48 <xsl:apply-templates/>
49 </xsl:copy>
50</xsl:template>
51
52<xsl:template match="preface|chapter|appendix|section|article">
53 <xsl:variable name="element.name">
54 <xsl:call-template name="element.name"/>
55 </xsl:variable>
56
57 <xsl:element name="{$element.name}" namespace="{$namespace}">
58 <xsl:apply-templates select="@*"/>
59 <xsl:apply-templates/>
60 </xsl:element>
61</xsl:template>
62
63<xsl:template name="element.name">
64 <xsl:param name="node" select="."/>
65
66 <xsl:variable name="src.element" select="concat(' ', local-name($node), ' ')"/>
67 <xsl:choose>
68 <xsl:when test="contains($topic.list, $src.element)">
69 <xsl:text>topic</xsl:text>
70 </xsl:when>
71 <xsl:otherwise>
72 <xsl:value-of select="local-name($node)"/>
73 </xsl:otherwise>
74 </xsl:choose>
75</xsl:template>
76
77</xsl:stylesheet>
78
Note: See TracBrowser for help on using the repository browser.