1 | <?xml version="1.0"?>
|
---|
2 | <!--
|
---|
3 | Stylesheet that extracts the DHCP option descriptions from
|
---|
4 | VirtualBox.xidl for cut & paste into man_VBoxManage-dhcpserver.xml.
|
---|
5 |
|
---|
6 |
|
---|
7 | Copyright (C) 2019-2020 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 | >
|
---|
22 |
|
---|
23 | <xsl:output method="text" version="1.0" encoding="utf-8" indent="yes"/>
|
---|
24 | <xsl:strip-space elements="*"/>
|
---|
25 |
|
---|
26 |
|
---|
27 | <!-- Default operation is to supress output -->
|
---|
28 | <xsl:template match="node()|@*">
|
---|
29 | <xsl:apply-templates/>
|
---|
30 | </xsl:template>
|
---|
31 |
|
---|
32 | <!--
|
---|
33 | The work.
|
---|
34 | -->
|
---|
35 | <xsl:template mode="emit" match="link[@to='IDHCPServer::networkMask']">
|
---|
36 | <xsl:text>the value of the --netmask option</xsl:text>
|
---|
37 | </xsl:template>
|
---|
38 |
|
---|
39 | <xsl:template mode="emit" match="link[@to='DHCPOptionEncoding::Hex']">
|
---|
40 | <xsl:text>--set-opt-hex</xsl:text>
|
---|
41 | </xsl:template>
|
---|
42 |
|
---|
43 | <xsl:template match="desc" mode="emit">
|
---|
44 | <xsl:apply-templates mode="emit"/>
|
---|
45 | </xsl:template>
|
---|
46 |
|
---|
47 | <xsl:template match="/idl/library/application/enum[@name='DHCPOption']/const">
|
---|
48 | <!-- <xsl:message><xsl:text>debug: </xsl:text><xsl:call-template name="get-node-path"/></xsl:message> -->
|
---|
49 | <xsl:text> <varlistentry>
|
---|
50 | <term></xsl:text><xsl:value-of select="concat(@value,' - ',@name)"/><xsl:text></term>
|
---|
51 | <listitem><para></xsl:text>
|
---|
52 | <xsl:apply-templates mode="emit"/>
|
---|
53 | <xsl:text></para></listitem>
|
---|
54 | </varlistentry></xsl:text>
|
---|
55 | </xsl:template>
|
---|
56 |
|
---|
57 | <xsl:template match="/">
|
---|
58 | <xsl:text><?xml version="1.0" encoding="UTF-8"?>
|
---|
59 | <!--
|
---|
60 | Manually generated from src/VBox/Main/idl/VirtualBox.xidl by 'kmk dhcpoptions'.
|
---|
61 | DO NOT EDIT!
|
---|
62 |
|
---|
63 |
|
---|
64 | Copyright (C) 2019-2020 Oracle Corporation
|
---|
65 |
|
---|
66 | This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
67 | available from http://www.virtualbox.org. This file is free software;
|
---|
68 | you can redistribute it and/or modify it under the terms of the GNU
|
---|
69 | General Public License (GPL) as published by the Free Software
|
---|
70 | Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
71 | VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
72 | hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
73 | -->
|
---|
74 |
|
---|
75 | <variablelist>
|
---|
76 | </xsl:text>
|
---|
77 | <xsl:apply-templates/>
|
---|
78 | <xsl:text>
|
---|
79 | </variablelist>
|
---|
80 | </xsl:text>
|
---|
81 | </xsl:template>
|
---|
82 |
|
---|
83 |
|
---|
84 | <!--
|
---|
85 | Debug/Diagnostics: Return the path to the specified node (by default the current).
|
---|
86 | -->
|
---|
87 | <xsl:template name="get-node-path">
|
---|
88 | <xsl:param name="Node" select="."/>
|
---|
89 | <xsl:for-each select="$Node">
|
---|
90 | <xsl:for-each select="ancestor-or-self::node()">
|
---|
91 | <xsl:choose>
|
---|
92 | <xsl:when test="name(.) = ''">
|
---|
93 | <xsl:text>text()</xsl:text>
|
---|
94 | </xsl:when>
|
---|
95 | <xsl:otherwise>
|
---|
96 | <xsl:value-of select="concat('/', name(.))"/>
|
---|
97 | <xsl:choose>
|
---|
98 | <xsl:when test="@id">
|
---|
99 | <xsl:text>[@id=</xsl:text>
|
---|
100 | <xsl:value-of select="@id"/>
|
---|
101 | <xsl:text>]</xsl:text>
|
---|
102 | </xsl:when>
|
---|
103 | <xsl:when test="position() > 1">
|
---|
104 | <xsl:text>[</xsl:text><xsl:value-of select="position()"/><xsl:text>]</xsl:text>
|
---|
105 | </xsl:when>
|
---|
106 | </xsl:choose>
|
---|
107 | </xsl:otherwise>
|
---|
108 | </xsl:choose>
|
---|
109 | </xsl:for-each>
|
---|
110 | </xsl:for-each>
|
---|
111 | </xsl:template>
|
---|
112 |
|
---|
113 | </xsl:stylesheet>
|
---|
114 |
|
---|