tdf#130857 qt weld: Support mail merge "Server Auth" dialog
[LibreOffice.git] / solenv / bin / createcomponent.xslt
blobee60221dfcdd723ce1ba0641a239209304674083
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:param name="filtered"/>
27 <xsl:strip-space elements="*"/>
28 <xsl:template match="uc:component">
29 <components>
30 <xsl:copy>
31 <xsl:apply-templates select="@*"/>
32 <xsl:attribute name="uri">
33 <xsl:value-of select="$uri"/>
34 </xsl:attribute>
35 <xsl:apply-templates/>
36 </xsl:copy>
37 </components>
38 </xsl:template>
39 <xsl:template match="uc:implementation">
40 <xsl:if test="not(contains($filtered,@name))">
41 <xsl:copy>
42 <xsl:apply-templates select="@*"/>
43 <xsl:apply-templates select="uc:optional"/>
44 <xsl:apply-templates/>
45 </xsl:copy>
46 </xsl:if>
47 </xsl:template>
48 <xsl:template match="uc:optional"/>
49 <xsl:template match="*">
50 <xsl:copy>
51 <xsl:apply-templates select="@*"/>
52 <xsl:apply-templates/>
53 </xsl:copy>
54 </xsl:template>
55 <xsl:template match="@environment">
56 <xsl:attribute name="environment">
57 <xsl:call-template name="replace">
58 <xsl:with-param name="input" select="current()"/>
59 <xsl:with-param name="pattern" select="'@CPPU_ENV@'"/>
60 <xsl:with-param name="replace" select="$cppu_env"/>
61 </xsl:call-template>
62 </xsl:attribute>
63 </xsl:template>
64 <xsl:template match="@*">
65 <xsl:copy/>
66 </xsl:template>
67 <xsl:template name="replace">
68 <xsl:param name="input"/>
69 <xsl:param name="pattern"/>
70 <xsl:param name="replace"/>
71 <xsl:choose>
72 <xsl:when test="contains($input, $pattern)">
73 <xsl:value-of select="substring-before($input, $pattern)"/>
74 <xsl:value-of select="$replace"/>
75 <xsl:call-template name="replace">
76 <xsl:with-param
77 name="input" select="substring-after($input, $pattern)"/>
78 <xsl:with-param name="pattern" select="$pattern"/>
79 <xsl:with-param name="replace" select="$replace"/>
80 </xsl:call-template>
81 </xsl:when>
82 <xsl:otherwise>
83 <xsl:value-of select="$input"/>
84 </xsl:otherwise>
85 </xsl:choose>
86 </xsl:template>
87 </xsl:stylesheet>