crashtesting: empty brace init of o3tl::enumarray doesn't zero each element
[LibreOffice.git] / xmlhelp / util / embed.xsl
blob0cc067714cf89272cc3412570c55e2fffc307ec0
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 -->
19 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
20 <xsl:output indent="yes" method="xml"/>
22 <!-- SPECIFY YOUR FILE SYSTEM ROOT PATH TO THE HELP FILES -->
23 <xsl:param name="fsroot" select="'file:///handbuch/WORKBENCH/helpcontent2/source/'"/>
25 <!--
26 ######################################################
27 All others
28 ######################################################
29 -->
30 <xsl:template match="/">
31 <xsl:apply-templates/>
32 </xsl:template>
34 <xsl:template match="*|@*|comment()|processing-instruction()|text()">
35 <xsl:copy>
36 <xsl:apply-templates select="*|@*|comment()|processing-instruction()|text()"/>
37 </xsl:copy>
38 </xsl:template>
40 <xsl:template match="*|@*|comment()|processing-instruction()|text()" mode="embedded">
41 <xsl:copy>
42 <xsl:apply-templates select="*|@*|comment()|processing-instruction()|text()" mode="embedded"/>
43 </xsl:copy>
44 </xsl:template>
46 <xsl:template match="bookmark" mode="embedded" />
47 <xsl:template match="ahelp" mode="embedded">
48 <xsl:apply-templates mode="embedded"/>
49 </xsl:template>
51 <xsl:template match="paragraph[@role='heading']">
52 <title>
53 <xsl:apply-templates/>
54 </title>
55 </xsl:template>
57 <xsl:template match="paragraph[@role=*]">
58 <paragraph>
59 <xsl:apply-templates/>
60 </paragraph>
61 </xsl:template>
63 <xsl:template match="sort">
64 <xsl:apply-templates/>
65 </xsl:template>
68 <!--
69 ######################################################
70 EMBED
71 ######################################################
72 -->
73 <xsl:template match="embed">
75 <xsl:variable name="href"><xsl:value-of select="substring-before(concat($fsroot,@href),'#')"/></xsl:variable>
76 <xsl:variable name="anchor"><xsl:value-of select="substring-after(@href,'#')"/></xsl:variable>
77 <xsl:variable name="doc" select="document($href)"/>
78 <xsl:apply-templates select="$doc//section[@id=$anchor]" mode="embedded"/>
79 <xsl:if test="not($doc//section[@id=$anchor])"> <!-- fallback for embeds that actually should be embedvars -->
80 <paragraph role="paragraph"><xsl:apply-templates select="$doc//variable[@id=$anchor]" mode="embedded"/></paragraph>
81 </xsl:if>
82 </xsl:template>
84 <!--
85 ######################################################
86 EMBEDVAR
87 ######################################################
88 -->
89 <xsl:template match="embedvar">
90 <xsl:if test="not(@href='text/shared/00/00000004.xhp#wie')"> <!-- special treatment if howtoget links -->
91 <xsl:variable name="href"><xsl:value-of select="substring-before(concat($fsroot,@href),'#')"/></xsl:variable>
92 <xsl:variable name="anchor"><xsl:value-of select="substring-after(@href,'#')"/></xsl:variable>
93 <xsl:variable name="doc" select="document($href)"/>
94 <xsl:apply-templates select="$doc//variable[@id=$anchor]" mode="embedded"/>
95 </xsl:if>
97 <!-- FPE: embedvars, that point to "text/shared/00/00000004.xml#wie" will only be resolved in the main_transform -->
99 </xsl:template>
100 </xsl:stylesheet>