1 | <!--
|
---|
2 | mark_external_urls.xsl:
|
---|
3 | - When href attribute of a xref element has http in its value
|
---|
4 | then add scope="external" attribute to that element. This attribute
|
---|
5 | tells dita pdf output java stuff not to retrieve and parse those documents.
|
---|
6 | -->
|
---|
7 | <!--
|
---|
8 | Copyright (C) 2006-2023 Oracle and/or its affiliates.
|
---|
9 |
|
---|
10 | This file is part of VirtualBox base platform packages, as
|
---|
11 | available from https://www.virtualbox.org.
|
---|
12 |
|
---|
13 | This program is free software; you can redistribute it and/or
|
---|
14 | modify it under the terms of the GNU General Public License
|
---|
15 | as published by the Free Software Foundation, in version 3 of the
|
---|
16 | License.
|
---|
17 |
|
---|
18 | This program is distributed in the hope that it will be useful, but
|
---|
19 | WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
21 | General Public License for more details.
|
---|
22 |
|
---|
23 | You should have received a copy of the GNU General Public License
|
---|
24 | along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
25 |
|
---|
26 | SPDX-License-Identifier: GPL-3.0-only
|
---|
27 | -->
|
---|
28 | <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
---|
29 | <xsl:output method="xml" indent="yes" omit-xml-declaration="no" standalone="no"/>
|
---|
30 | <xsl:output encoding='UTF-8' doctype-public="-//OASIS//DTD DITA Reference//EN" doctype-system="reference.dtd"/>
|
---|
31 |
|
---|
32 | <xsl:template match="node()|@*">
|
---|
33 | <xsl:copy>
|
---|
34 | <xsl:apply-templates select="node()|@*"/>
|
---|
35 | </xsl:copy>
|
---|
36 | </xsl:template>
|
---|
37 |
|
---|
38 | <xsl:template match="xref">
|
---|
39 | <xsl:choose>
|
---|
40 | <xsl:when test="contains(@href, 'http')">
|
---|
41 | <xsl:copy>
|
---|
42 | <xsl:attribute name="scope">external</xsl:attribute>
|
---|
43 | <xsl:apply-templates select="@*|node()"/>
|
---|
44 | </xsl:copy>
|
---|
45 | </xsl:when>
|
---|
46 | <xsl:otherwise>
|
---|
47 | <xsl:copy-of select="."/>
|
---|
48 | </xsl:otherwise>
|
---|
49 | </xsl:choose>
|
---|
50 | </xsl:template>
|
---|
51 | </xsl:stylesheet>
|
---|