VirtualBox

source: vbox/trunk/doc/manual/ditamap-to-single-xml.xsl@ 99515

Last change on this file since 99515 was 99515, checked in by vboxsync, 13 months ago

manual: Added the changelog to the (DITA) manual. [build fix] bugref:10302

  • 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 ditamap-to-single-xml.xsl:
4 XSLT stylesheet for generate a xml document that includes all the
5 topics references by a ditamap file (using xi:include). The product
6 is of course not a valid document, but should suffice for harvesting
7 information, like for the link replacements in the help text.
8-->
9<!--
10 Copyright (C) 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 >
35
36 <xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes" omit-xml-declaration="no"/>
37 <xsl:strip-space elements="*"/>
38
39 <!-- prefaceref -> prefacewrap -->
40 <xsl:template match="preface">
41 <prefacewrap>
42 <xi:include href="{./@href}" xmlns:xi="http://www.w3.org/2001/XInclude" xpointer="xpointer(/topic)" />
43 <xsl:apply-templates select="node()" />
44 </prefacewrap>
45 </xsl:template>
46
47 <!-- topicref -> topicwrap; but not man_xxxx (need converting) and glossentry-xxxx (not topics) references -->
48 <xsl:template match="topicref">
49 <xsl:if test="not(contains(@href, 'man_')) and not(contains(@href, '-man.')) and not(contains(@href, 'glossentry-')) and not(contains(@href, '.ditamap'))">
50 <topicwrap>
51 <xi:include href="{./@href}" xmlns:xi="http://www.w3.org/2001/XInclude" xpointer="xpointer(/topic)" />
52 <xsl:apply-templates select="node()" />
53 </topicwrap>
54 </xsl:if>
55 </xsl:template>
56
57 <!-- chapter/@href -> chapter + xi:include/@href (no wrapper) -->
58 <xsl:template match="chapter">
59 <xsl:copy>
60 <xi:include href="{./@href}" xmlns:xi="http://www.w3.org/2001/XInclude" xpointer="xpointer(/topic)" />
61 <xsl:apply-templates select="node()" />
62 </xsl:copy>
63 </xsl:template>
64
65 <!-- copy everything else -->
66 <xsl:template match="node()|@*">
67 <xsl:copy>
68 <xsl:apply-templates select="node()|@*" />
69 </xsl:copy>
70 </xsl:template>
71
72</xsl:stylesheet>
73
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use