VirtualBox

source: vbox/trunk/doc/manual/docbook-refentry-to-manual-dita-pre.xsl@ 99099

Last change on this file since 99099 was 99099, checked in by vboxsync, 14 months ago

manual: Start of a refentry to dita converter. bugref:10302

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.6 KB
Line 
1<?xml version="1.0"?>
2<!--
3 docbook-refentry-to-manual-dita-pre.xsl:
4 XSLT stylesheet for preprocessing a refentry (manpage)
5 before converting it to dita for use in the user manual.
6
7 This just applies remark elements.
8-->
9<!--
10 Copyright (C) 2006-2023 Oracle and/or its affiliates.
11
12 This file is part of VirtualBox base platform packages, as
13 available from https://www.virtualbox.org.
14
15 This program is free software; you can redistribute it and/or
16 modify it under the terms of the GNU General Public License
17 as published by the Free Software Foundation, in version 3 of the
18 License.
19
20 This program is distributed in the hope that it will be useful, but
21 WITHOUT ANY WARRANTY; without even the implied warranty of
22 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 General Public License for more details.
24
25 You should have received a copy of the GNU General Public License
26 along with this program; if not, see <https://www.gnu.org/licenses>.
27
28 SPDX-License-Identifier: GPL-3.0-only
29-->
30
31<xsl:stylesheet
32 version="1.0"
33 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
34 xmlns:str="http://xsltsl.org/string"
35 >
36
37 <xsl:import href="string.xsl"/>
38
39 <xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes"/>
40 <xsl:strip-space elements="*"/>
41
42
43<!-- - - - - - - - - - - - - - - - - - - - - - -
44 base operation is to copy.
45 - - - - - - - - - - - - - - - - - - - - - - -->
46
47<xsl:template match="node()|@*">
48 <xsl:copy>
49 <xsl:apply-templates select="node()|@*"/>
50 </xsl:copy>
51</xsl:template>
52
53
54<!--
55 remark extensions:
56 -->
57<!-- Default: remove all remarks. -->
58<xsl:template match="remark"/>
59
60<!-- help-manual - stuff that should only be included in the manual. -->
61<xsl:template match="remark[@role = 'help-manual']">
62 <xsl:apply-templates/>
63</xsl:template>
64
65<!-- help-copy-synopsis - used in refsect2 to copy synopsis from the refsynopsisdiv. -->
66<xsl:template match="remark[@role = 'help-copy-synopsis']">
67 <xsl:if test="not(parent::refsect2)">
68 <xsl:message terminate="yes">The help-copy-synopsis remark is only applicable in refsect2.</xsl:message>
69 </xsl:if>
70 <xsl:variable name="sSrcId" select="concat('synopsis-',../@id)"/>
71 <xsl:if test="not(/refentry/refsynopsisdiv/cmdsynopsis[@id = $sSrcId])">
72 <xsl:message terminate="yes">Could not find any cmdsynopsis with id=<xsl:value-of select="$sSrcId"/> in refsynopsisdiv.</xsl:message>
73 </xsl:if>
74 <xsl:element name="cmdsynopsis">
75 <xsl:copy-of select="/refentry/refsynopsisdiv/cmdsynopsis[@id = $sSrcId]/node()"/>
76 </xsl:element>
77</xsl:template>
78
79
80</xsl:stylesheet>
81
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use