bump product version to 4.2.0.1
[LibreOffice.git] / officecfg / util / schema_trim.xsl
blob79b3c5c8cb4ff7d39ebd1dfaa20a83c264624181
1 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
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 -->
20 <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
21 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
22 xmlns:xs="http://www.w3.org/2001/XMLSchema"
23 xmlns:oor="http://openoffice.org/2001/registry"
24 version="1.0">
26 <xsl:param name="LIBO_SHARE_FOLDER"/>
28 <!-- Get the correct format -->
29 <xsl:output method="xml" indent="yes"/>
30 <xsl:namespace-alias stylesheet-prefix="xs" result-prefix="xs"></xsl:namespace-alias>
33 <!-- Remove all comments from the schema files -->
34 <xsl:template match="*|@*">
35 <xsl:copy>
36 <xsl:apply-templates select="*|@*"/>
37 </xsl:copy>
38 </xsl:template>
40 <!-- suppress the location of the schema -->
41 <xsl:template match = "@xsi:schemaLocation"/>
43 <!-- suppress the constraints of the schema
44 <xsl:template match = "constraints"/> -->
46 <!-- suppress all documentation items
47 <xsl:template match = "info"/> -->
49 <!-- suppress constraints for deprecated items -->
50 <xsl:template match = "constraints[../info/deprecated]"/>
52 <!-- suppress all documentation for deprecated items -->
53 <xsl:template match = "desc[../deprecated]"/>
54 <xsl:template match = "label[../deprecated]"/>
56 <!-- copy all other documentation with content -->
57 <xsl:template match="desc|label">
58 <xsl:copy>
59 <xsl:apply-templates select="@*"/>
60 <xsl:value-of select="."/>
61 </xsl:copy>
62 </xsl:template>
64 <!-- suppress all author items -->
65 <xsl:template match = "author"/>
67 <!-- suppress values, which are marked as nil -->
68 <xsl:template match="value[@xsi:nil='true']" />
70 <!-- copy all other values with content -->
71 <xsl:template match="value">
72 <xsl:copy>
73 <xsl:apply-templates select="@*|node()"/>
74 </xsl:copy>
75 </xsl:template>
77 <xsl:template match ="it|unicode">
78 <xsl:copy>
79 <xsl:apply-templates select = "@*|node()"/>
80 </xsl:copy>
81 </xsl:template>
83 <xsl:template match="text()">
84 <xsl:call-template name="replace">
85 <xsl:with-param name="input" select="current()"/>
86 <xsl:with-param name="pattern" select="'@LIBO_SHARE_FOLDER@'"/>
87 <xsl:with-param name="replace" select="$LIBO_SHARE_FOLDER"/>
88 </xsl:call-template>
89 </xsl:template>
91 <xsl:template name="replace">
92 <xsl:param name="input"/>
93 <xsl:param name="pattern"/>
94 <xsl:param name="replace"/>
95 <xsl:choose>
96 <xsl:when test="contains($input, $pattern)">
97 <xsl:value-of select="substring-before($input, $pattern)"/>
98 <xsl:value-of select="$replace"/>
99 <xsl:call-template name="replace">
100 <xsl:with-param
101 name="input" select="substring-after($input, $pattern)"/>
102 <xsl:with-param name="pattern" select="$pattern"/>
103 <xsl:with-param name="replace" select="$replace"/>
104 </xsl:call-template>
105 </xsl:when>
106 <xsl:otherwise>
107 <xsl:value-of select="$input"/>
108 </xsl:otherwise>
109 </xsl:choose>
110 </xsl:template>
112 </xsl:transform>