bump product version to 5.0.4.1
[LibreOffice.git] / solenv / bin / createcomponent.xslt
blob4e20a2db19013c628361572972e9d9787ebc9330
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 -->
20 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
21 exclude-result-prefixes="uc"
22 xmlns="http://openoffice.org/2010/uno-components"
23 xmlns:uc="http://openoffice.org/2010/uno-components">
24 <xsl:param name="uri"/>
25 <xsl:param name="cppu_env"/>
26 <xsl:strip-space elements="*"/>
27 <xsl:template match="uc:component">
28 <components>
29 <xsl:copy>
30 <xsl:apply-templates select="@*"/>
31 <xsl:attribute name="uri">
32 <xsl:value-of select="$uri"/>
33 </xsl:attribute>
34 <xsl:apply-templates/>
35 </xsl:copy>
36 </components>
37 </xsl:template>
38 <xsl:template match="*">
39 <xsl:copy>
40 <xsl:apply-templates select="@*"/>
41 <xsl:apply-templates/>
42 </xsl:copy>
43 </xsl:template>
44 <xsl:template match="@environment">
45 <xsl:attribute name="environment">
46 <xsl:call-template name="replace">
47 <xsl:with-param name="input" select="current()"/>
48 <xsl:with-param name="pattern" select="'@CPPU_ENV@'"/>
49 <xsl:with-param name="replace" select="$cppu_env"/>
50 </xsl:call-template>
51 </xsl:attribute>
52 </xsl:template>
53 <xsl:template match="@*">
54 <xsl:copy/>
55 </xsl:template>
56 <xsl:template name="replace">
57 <xsl:param name="input"/>
58 <xsl:param name="pattern"/>
59 <xsl:param name="replace"/>
60 <xsl:choose>
61 <xsl:when test="contains($input, $pattern)">
62 <xsl:value-of select="substring-before($input, $pattern)"/>
63 <xsl:value-of select="$replace"/>
64 <xsl:call-template name="replace">
65 <xsl:with-param
66 name="input" select="substring-after($input, $pattern)"/>
67 <xsl:with-param name="pattern" select="$pattern"/>
68 <xsl:with-param name="replace" select="$replace"/>
69 </xsl:call-template>
70 </xsl:when>
71 <xsl:otherwise>
72 <xsl:value-of select="$input"/>
73 </xsl:otherwise>
74 </xsl:choose>
75 </xsl:template>
76 </xsl:stylesheet>