VirtualBox

source: vbox/trunk/doc/manual/docbook-refentry-to-H-help.xsl@ 62009

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

VBoxManage,manual: Working help code generator.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
  • Property svn:mergeinfo set to (toggle deleted branches)
    /branches/VBox-3.0/doc/manual/docbook-refentry-to-manual-overview.xsl58652,​70973
    /branches/VBox-3.2/doc/manual/docbook-refentry-to-manual-overview.xsl66309,​66318
    /branches/VBox-4.0/doc/manual/docbook-refentry-to-manual-overview.xsl70873
    /branches/VBox-4.1/doc/manual/docbook-refentry-to-manual-overview.xsl74233,​78414,​78691,​82579,​85941,​85944-85947,​85949-85950,​85953,​86701,​86728,​87009
    /branches/VBox-4.2/doc/manual/docbook-refentry-to-manual-overview.xsl82653,​86229-86230,​86234,​86529,​91503-91504,​91506-91508,​91510,​91514-91515,​91521
    /branches/VBox-4.3/doc/manual/docbook-refentry-to-manual-overview.xsl91223,​94066,​94839,​94897,​95154,​95164,​95167,​95295,​95338,​95353-95354,​95356,​95367,​95451,​95475,​95477,​95480,​95507,​95640,​95659,​95661,​95663,​98913-98915,​99358
    /branches/VBox-4.3/trunk/doc/manual/docbook-refentry-to-manual-overview.xsl91223
    /branches/andy/draganddrop/doc/manual/docbook-refentry-to-manual-overview.xsl90781-91268
    /branches/andy/guestctrl20/doc/manual/docbook-refentry-to-manual-overview.xsl78916,​78930
    /branches/andy/pdmaudio/doc/manual/docbook-refentry-to-manual-overview.xsl94582,​94641,​94654,​94688,​94778,​94783,​94816,​95197,​95215-95216,​95250,​95279,​95505-95506,​95543,​95694,​96323,​96470-96471,​96582,​96587,​96802-96803,​96817,​96904,​96967,​96999,​97020-97021,​97025,​97050,​97099
    /branches/bird/hardenedwindows/doc/manual/docbook-refentry-to-manual-overview.xsl92692-94610
    /branches/dsen/gui/doc/manual/docbook-refentry-to-manual-overview.xsl79076-79078,​79089,​79109-79110,​79112-79113,​79127-79130,​79134,​79141,​79151,​79155,​79157-79159,​79193,​79197
    /branches/dsen/gui2/doc/manual/docbook-refentry-to-manual-overview.xsl79224,​79228,​79233,​79235,​79258,​79262-79263,​79273,​79341,​79345,​79354,​79357,​79387-79388,​79559-79569,​79572-79573,​79578,​79581-79582,​79590-79591,​79598-79599,​79602-79603,​79605-79606,​79632,​79635,​79637,​79644
    /branches/dsen/gui3/doc/manual/docbook-refentry-to-manual-overview.xsl79645-79692
    /trunk/src/doc/manual/docbook-refentry-to-manual-overview.xsl92342
File size: 3.3 KB
Line 
1<?xml version="1.0"?>
2<!--
3 docbook-refentry-to-H-help.xsl:
4 XSLT stylesheet for generating command and sub-command
5 constants header for the built-in help.
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="@VBOX_PATH_MANUAL_SRC@/string.xsl"/>
25
26 <xsl:output method="text" version="1.0" encoding="utf-8" indent="yes"/>
27 <xsl:strip-space elements="*"/>
28
29 <xsl:param name="g_sMode" select="not-specified"/>
30
31
32 <!-- Default action, do nothing. -->
33 <xsl:template match="node()|@*"/>
34
35 <!--
36 Generate SCOPE enum for a refentry. We convert the
37 cmdsynopsisdiv/cmdsynopsis IDs into constants.
38 -->
39 <xsl:template match="refentry">
40 <xsl:variable name="sBaseNm">
41 <xsl:call-template name="str:to-upper">
42 <xsl:with-param name="text" select="translate(substring-after(@id, '-'), '-', '_')"/>
43 </xsl:call-template>
44 </xsl:variable>
45
46 <xsl:choose>
47 <!-- Generate subcommand enums and defines -->
48 <xsl:when test="$g_sMode = 'subcmd'">
49 <xsl:text>
50enum
51{
52#define HELP_SCOPE_</xsl:text>
53 <xsl:value-of select="$sBaseNm"/>
54 <xsl:value-of select="substring(' ',1,56 - string-length($sBaseNm) - 11)"/>
55 <xsl:text> RT_BIT_32(HELP_SCOPE_</xsl:text><xsl:value-of select="$sBaseNm"/><xsl:text>_BIT)
56 HELP_SCOPE_</xsl:text><xsl:value-of select="$sBaseNm"/><xsl:text>_BIT = 0</xsl:text>
57 <xsl:for-each select="./refsynopsisdiv/cmdsynopsis">
58 <xsl:variable name="sSubNm">
59 <xsl:text>HELP_SCOPE_</xsl:text>
60 <xsl:call-template name="str:to-upper">
61 <xsl:with-param name="text" select="translate(substring-after(substring-after(@id, '-'), '-'), '-', '_')"/>
62 </xsl:call-template>
63 </xsl:variable>
64 <xsl:text>,
65#define </xsl:text>
66 <xsl:value-of select="$sSubNm"/>
67 <xsl:value-of select="substring(' ',1,56 - string-length($sSubNm))"/>
68 <xsl:text> RT_BIT_32(</xsl:text><xsl:value-of select="$sSubNm"/><xsl:text>_BIT)
69 </xsl:text><xsl:value-of select="$sSubNm"/><xsl:text>_BIT</xsl:text>
70 </xsl:for-each>
71
72 <xsl:text>,
73 HELP_SCOPE_</xsl:text><xsl:value-of select="$sBaseNm"/><xsl:text>_END
74};
75</xsl:text>
76 </xsl:when>
77
78 <!-- Generate command enum value. -->
79 <xsl:when test="$g_sMode = 'cmd'">
80 <xsl:text> HELP_CMD_</xsl:text><xsl:value-of select="$sBaseNm"/><xsl:text>,
81</xsl:text>
82 </xsl:when>
83
84 <!-- Shouldn't happen. -->
85 <xsl:otherwise>
86 <xsl:message terminate="yes">Bad or missing g_sMode string parameter value.</xsl:message>
87 </xsl:otherwise>
88 </xsl:choose>
89 </xsl:template>
90
91</xsl:stylesheet>
92
Note: See TracBrowser for help on using the repository browser.

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