1 | <?xml version="1.0"?>
|
---|
2 | <!--
|
---|
3 | docbook-refentry-to-manual-sect1.xsl:
|
---|
4 | XSLT stylesheet for nicking the refsynopsisdiv bit of a
|
---|
5 | refentry (manpage) for use in the command overview section
|
---|
6 | in the user manual.
|
---|
7 | -->
|
---|
8 | <!--
|
---|
9 | Copyright (C) 2006-2022 Oracle and/or its affiliates.
|
---|
10 |
|
---|
11 | This file is part of VirtualBox base platform packages, as
|
---|
12 | available from https://www.virtualbox.org.
|
---|
13 |
|
---|
14 | This program is free software; you can redistribute it and/or
|
---|
15 | modify it under the terms of the GNU General Public License
|
---|
16 | as published by the Free Software Foundation, in version 3 of the
|
---|
17 | License.
|
---|
18 |
|
---|
19 | This program is distributed in the hope that it will be useful, but
|
---|
20 | WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
21 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
22 | General Public License for more details.
|
---|
23 |
|
---|
24 | You should have received a copy of the GNU General Public License
|
---|
25 | along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
26 |
|
---|
27 | SPDX-License-Identifier: GPL-3.0-only
|
---|
28 | -->
|
---|
29 |
|
---|
30 | <xsl:stylesheet
|
---|
31 | version="1.0"
|
---|
32 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
---|
33 | >
|
---|
34 |
|
---|
35 | <xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes"/>
|
---|
36 | <xsl:strip-space elements="*"/>
|
---|
37 |
|
---|
38 |
|
---|
39 | <!-- Base operation is to copy. -->
|
---|
40 | <xsl:template match="node()|@*">
|
---|
41 | <xsl:copy>
|
---|
42 | <xsl:apply-templates select="node()|@*"/>
|
---|
43 | </xsl:copy>
|
---|
44 | </xsl:template>
|
---|
45 |
|
---|
46 | <!--
|
---|
47 | The refentry element is the top level one. We only process the
|
---|
48 | refsynopsisdiv sub element within it, since that is all we want.
|
---|
49 | -->
|
---|
50 | <xsl:template match="refentry">
|
---|
51 | <xsl:apply-templates select="refsynopsisdiv"/>
|
---|
52 | </xsl:template>
|
---|
53 |
|
---|
54 | <!--
|
---|
55 | Combine all cmdsynopsis lines into a bunch of commands.
|
---|
56 | -->
|
---|
57 | <xsl:template match="refsynopsisdiv">
|
---|
58 | <xsl:if test="not(cmdsynopsis)">
|
---|
59 | <xsl:message terminate="yes">What? No cmdsynopsis in the refsynopsisdiv?</xsl:message>
|
---|
60 | </xsl:if>
|
---|
61 | <xsl:element name="cmdsynopsis">
|
---|
62 | <xsl:attribute name="id"><xsl:value-of select="/refentry/@id"/><xsl:text>-overview</xsl:text></xsl:attribute>
|
---|
63 | <xsl:for-each select="cmdsynopsis">
|
---|
64 | <xsl:copy-of select="node()"/>
|
---|
65 | </xsl:for-each>
|
---|
66 | </xsl:element>
|
---|
67 | </xsl:template>
|
---|
68 |
|
---|
69 | <!-- Remove all remarks (for now). -->
|
---|
70 | <xsl:template match="remark"/>
|
---|
71 |
|
---|
72 |
|
---|
73 | </xsl:stylesheet>
|
---|
74 |
|
---|