1 <?xml version=
"1.0" encoding=
"utf-8" standalone=
"yes" ?> <!-- -*- indent-tabs-mode: nil -*- -->
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 .
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"
26 <xsl:param name=
"LIBO_SHARE_FOLDER"/>
27 <xsl:param name=
"LIBO_SHARE_HELP_FOLDER"/>
29 <!-- Get the correct format -->
30 <xsl:output method=
"xml" indent=
"yes"/>
31 <xsl:namespace-alias stylesheet-prefix=
"xs" result-prefix=
"xs"></xsl:namespace-alias>
33 <!-- Remove all comments from the schema files -->
34 <xsl:template match=
"*|@*">
36 <xsl:apply-templates select=
"*|@*"/>
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">
59 <xsl:apply-templates select=
"@*"/>
60 <xsl:value-of select=
"."/>
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">
73 <xsl:apply-templates select=
"@*|node()"/>
77 <xsl:template match =
"it|unicode">
79 <xsl:apply-templates select =
"@*|node()"/>
83 <xsl:template match=
"text()">
84 <xsl:call-template name=
"replacetwo">
85 <xsl:with-param name=
"input" select=
"current()"/>
86 <xsl:with-param name=
"pattern1" select=
"'@LIBO_SHARE_FOLDER@'"/>
87 <xsl:with-param name=
"replace1" select=
"$LIBO_SHARE_FOLDER"/>
88 <xsl:with-param name=
"pattern2" select=
"'@LIBO_SHARE_HELP_FOLDER@'"/>
89 <xsl:with-param name=
"replace2" select=
"$LIBO_SHARE_HELP_FOLDER"/>
93 <xsl:template name=
"replace">
94 <xsl:param name=
"input"/>
95 <xsl:param name=
"pattern"/>
96 <xsl:param name=
"replace"/>
98 <xsl:when test=
"contains($input, $pattern)">
99 <xsl:value-of select=
"substring-before($input, $pattern)"/>
100 <xsl:value-of select=
"$replace"/>
101 <xsl:call-template name=
"replace">
102 <xsl:with-param name=
"input" select=
"substring-after($input, $pattern)"/>
103 <xsl:with-param name=
"pattern" select=
"$pattern"/>
104 <xsl:with-param name=
"replace" select=
"$replace"/>
108 <xsl:value-of select=
"$input"/>
113 <xsl:template name=
"replacetwo">
114 <xsl:param name=
"input"/>
115 <xsl:param name=
"pattern1"/>
116 <xsl:param name=
"replace1"/>
117 <xsl:param name=
"pattern2"/>
118 <xsl:param name=
"replace2"/>
120 <xsl:when test=
"contains($input, $pattern1)">
121 <xsl:call-template name=
"replace">
122 <xsl:with-param name=
"input" select=
"substring-before($input, $pattern1)"/>
123 <xsl:with-param name=
"pattern" select=
"$pattern2"/>
124 <xsl:with-param name=
"replace" select=
"$replace2"/>
126 <xsl:value-of select=
"$replace1"/>
127 <xsl:call-template name=
"replacetwo">
128 <xsl:with-param name=
"input" select=
"substring-after($input, $pattern1)"/>
129 <xsl:with-param name=
"pattern1" select=
"$pattern1"/>
130 <xsl:with-param name=
"replace1" select=
"$replace1"/>
131 <xsl:with-param name=
"pattern2" select=
"$pattern2"/>
132 <xsl:with-param name=
"replace2" select=
"$replace2"/>
136 <xsl:call-template name=
"replace">
137 <xsl:with-param name=
"input" select=
"$input"/>
138 <xsl:with-param name=
"pattern" select=
"$pattern2"/>
139 <xsl:with-param name=
"replace" select=
"$replace2"/>