/usr/share/boostbook/xsl/dtd/dtd2boostbook.xsl is in libboost1.54-tools-dev 1.54.0-4ubuntu3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 | <?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="xml" indent="yes" standalone="yes"/>
<xsl:strip-space elements="sequence-group or-group element element-name"/>
<xsl:key name="elements" match="element" use="@name"/>
<xsl:key name="attributes" match="attlist" use="@name"/>
<xsl:key name="attribute-purposes" match="attpurpose" use="@name"/>
<xsl:template match="dtd">
<section id="reference">
<title>Reference</title>
<para>
<xsl:text>Elements:</xsl:text>
<itemizedlist spacing="compact">
<xsl:apply-templates select="element" mode="synopsis">
<xsl:sort select="@name"/>
</xsl:apply-templates>
</itemizedlist>
</para>
<xsl:apply-templates select="element"/>
</section>
</xsl:template>
<!-- Element synopsis -->
<xsl:template match="element" mode="synopsis">
<listitem>
<simpara>
<link>
<xsl:attribute name="linkend">
<xsl:value-of select="concat('boostbook.dtd.',@name)"/>
</xsl:attribute>
<xsl:text>Element </xsl:text>
<sgmltag><xsl:value-of select="@name"/></sgmltag>
<xsl:text> - </xsl:text>
<xsl:apply-templates select="purpose"/>
</link>
</simpara>
</listitem>
</xsl:template>
<!-- Elements are transformed into DocBook refentry elements -->
<xsl:template match="element">
<refentry>
<xsl:attribute name="id">
<xsl:value-of select="concat('boostbook.dtd.',@name)"/>
</xsl:attribute>
<refmeta>
<refentrytitle>
BoostBook element <sgmltag><xsl:value-of select="@name"/></sgmltag>
</refentrytitle>
<manvolnum>9</manvolnum>
</refmeta>
<refnamediv>
<refname><xsl:value-of select="@name"/></refname>
<refpurpose><xsl:apply-templates select="purpose"/></refpurpose>
</refnamediv>
<refsynopsisdiv>
<xsl:value-of select="@name"/><xsl:text> ::= </xsl:text>
<xsl:apply-templates select="content-model-expanded"/>
</refsynopsisdiv>
<xsl:apply-templates select="description"/>
<xsl:apply-templates select="key('attributes', @name)"/>
</refentry>
</xsl:template>
<xsl:template match="content-model-expanded">
<xsl:apply-templates/>
</xsl:template>
<!-- Sequences -->
<xsl:template match="sequence-group">
<xsl:param name="separator" select="''"/>
<xsl:if test="preceding-sibling::*">
<xsl:value-of select="$separator"/>
</xsl:if>
<xsl:text>(</xsl:text>
<xsl:apply-templates>
<xsl:with-param name="separator" select="', '"/>
</xsl:apply-templates>
<xsl:text>)</xsl:text>
<xsl:value-of select="@occurrence"/>
</xsl:template>
<!-- Alternatives -->
<xsl:template match="or-group">
<xsl:param name="separator" select="''"/>
<xsl:if test="preceding-sibling::*">
<xsl:value-of select="$separator"/>
</xsl:if>
<xsl:text>(</xsl:text>
<xsl:apply-templates>
<xsl:with-param name="separator" select="'| '"/>
</xsl:apply-templates>
<xsl:text>)</xsl:text>
<xsl:value-of select="@occurrence"/>
</xsl:template>
<!-- Element references -->
<xsl:template match="element-name">
<xsl:param name="separator" select="''"/>
<xsl:if test="preceding-sibling::*">
<xsl:value-of select="$separator"/>
</xsl:if>
<xsl:variable name="element-node" select="key('elements', @name)"/>
<xsl:choose>
<xsl:when test="$element-node">
<link>
<xsl:attribute name="linkend">
<xsl:value-of select="concat('boostbook.dtd.',@name)"/>
</xsl:attribute>
<xsl:value-of select="@name"/>
</link>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@name"/>
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="@occurrence"/>
</xsl:template>
<!-- #PCDATA -->
<xsl:template match="pcdata">
<xsl:param name="separator" select="''"/>
<xsl:if test="preceding-sibling::*">
<xsl:value-of select="$separator"/>
</xsl:if>
<xsl:text>#PCDATA</xsl:text>
</xsl:template>
<!-- ANY -->
<xsl:template match="any">
<xsl:text>ANY</xsl:text>
</xsl:template>
<!-- EMPTY -->
<xsl:template match="empty">
<xsl:text>EMPTY</xsl:text>
</xsl:template>
<!-- Just copy anything in a purpose element -->
<xsl:template match="purpose">
<xsl:copy-of select="text()|*"/>
</xsl:template>
<!-- Just copy anything in a description element, but place it in a
section. -->
<xsl:template match="description">
<refsection>
<title>Description</title>
<xsl:copy-of select="text()|*"/>
</refsection>
</xsl:template>
<!-- Attributes -->
<xsl:template match="attlist">
<refsection>
<title>Attributes</title>
<informaltable>
<tgroup cols="4">
<thead>
<row>
<entry>Name</entry>
<entry>Type</entry>
<entry>Value</entry>
<entry>Purpose</entry>
</row>
</thead>
<tbody>
<xsl:apply-templates/>
</tbody>
</tgroup>
</informaltable>
</refsection>
</xsl:template>
<!-- Attribute -->
<xsl:template match="attribute">
<row>
<entry><xsl:value-of select="@name"/></entry>
<entry><xsl:value-of select="@type"/></entry>
<entry><xsl:value-of select="@value"/></entry>
<entry>
<xsl:choose>
<xsl:when test="purpose">
<xsl:apply-templates select="purpose"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="key('attribute-purposes', @name)"/>
</xsl:otherwise>
</xsl:choose>
</entry>
</row>
</xsl:template>
<!-- Eat attribute declarations -->
<xsl:template match="attdecl"/>
</xsl:stylesheet>
|