VirtualBox

source: vbox/trunk/doc/manual/docbook-refentry-to-manual-sect1.xsl@ 56436

Last change on this file since 56436 was 56436, checked in by vboxsync, 10 years ago

props

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.7 KB
Line 
1<?xml version="1.0"?>
2<!--
3 docbook-refentry-to-manual-sect1.xsl:
4 XSLT stylesheet for transforming a refentry (manpage)
5 to a sect1 for the user manual.
6
7 Copyright (C) 2006-2015 Oracle Corporation
8
9 This file is part of VirtualBox Open Source Edition (OSE), as
10 available from http://www.virtualbox.org. This file is free software;
11 you can redistribute it and/or modify it under the terms of the GNU
12 General Public License (GPL) as published by the Free Software
13 Foundation, in version 2 as it comes in the "COPYING" file of the
14 VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16-->
17
18<xsl:stylesheet
19 version="1.0"
20 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
21 xmlns:str="http://xsltsl.org/string"
22 >
23
24 <xsl:import href="string.xsl"/>
25
26 <xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes"/>
27 <xsl:strip-space elements="*"/>
28
29
30<!-- - - - - - - - - - - - - - - - - - - - - - -
31 global XSLT variables
32 - - - - - - - - - - - - - - - - - - - - - - -->
33
34
35
36<!-- - - - - - - - - - - - - - - - - - - - - - -
37 base operation is to copy.
38 - - - - - - - - - - - - - - - - - - - - - - -->
39
40<xsl:template match="node()|@*">
41 <xsl:copy>
42 <xsl:apply-templates select="node()|@*"/>
43 </xsl:copy>
44</xsl:template>
45
46
47<!-- - - - - - - - - - - - - - - - - - - - - - -
48
49 - - - - - - - - - - - - - - - - - - - - - - -->
50
51<!-- rename refentry to sect1 -->
52<xsl:template match="refentry">
53 <sect1>
54 <xsl:apply-templates select="node()|@*"/>
55 </sect1>
56</xsl:template>
57
58<!-- Remove refentryinfo, keeping the title element. -->
59<xsl:template match="refentryinfo">
60 <xsl:if test="./title">
61 <xsl:copy-of select="./title"/>
62 </xsl:if>
63</xsl:template>
64
65<!-- Morph refnamediv into a brief description. -->
66<xsl:template match="refnamediv">
67 <para>
68 <xsl:call-template name="capitalize">
69 <xsl:with-param name="text" select="normalize-space(./refpurpose)"/>
70 </xsl:call-template>
71 <xsl:text>.</xsl:text>
72 </para>
73</xsl:template>
74
75<!-- Remove refmeta. -->
76<xsl:template match="refmeta"/>
77
78<!--
79 remark extensions:
80 -->
81<!-- Default: remove all remarks. -->
82<xsl:template match="remark"/>
83
84<!-- help-manual - stuff that should only be included in the manual. -->
85<xsl:template match="remark[@role = 'help-manual']">
86 <xsl:apply-templates/>
87</xsl:template>
88
89
90<!--
91 Captializes the given text.
92 -->
93<xsl:template name="capitalize">
94 <xsl:param name="text"/>
95 <xsl:call-template name="str:to-upper">
96 <xsl:with-param name="text" select="substring($text,1,1)"/>
97 </xsl:call-template>
98 <xsl:value-of select="substring($text,2)"/>
99</xsl:template>
100
101</xsl:stylesheet>
102
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette