xref: /aoo41x/main/solenv/bin/packcomponents.xslt (revision 85596f7b)
1cdf0e10cSrcweir<?xml version="1.0" encoding="UTF-8"?>
2*85596f7bSAndrew Rist<!--***********************************************************
3*85596f7bSAndrew Rist *
4*85596f7bSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
5*85596f7bSAndrew Rist * or more contributor license agreements.  See the NOTICE file
6*85596f7bSAndrew Rist * distributed with this work for additional information
7*85596f7bSAndrew Rist * regarding copyright ownership.  The ASF licenses this file
8*85596f7bSAndrew Rist * to you under the Apache License, Version 2.0 (the
9*85596f7bSAndrew Rist * "License"); you may not use this file except in compliance
10*85596f7bSAndrew Rist * with the License.  You may obtain a copy of the License at
11*85596f7bSAndrew Rist *
12*85596f7bSAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
13*85596f7bSAndrew Rist *
14*85596f7bSAndrew Rist * Unless required by applicable law or agreed to in writing,
15*85596f7bSAndrew Rist * software distributed under the License is distributed on an
16*85596f7bSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17*85596f7bSAndrew Rist * KIND, either express or implied.  See the License for the
18*85596f7bSAndrew Rist * specific language governing permissions and limitations
19*85596f7bSAndrew Rist * under the License.
20*85596f7bSAndrew Rist *
21*85596f7bSAndrew Rist ***********************************************************-->
22*85596f7bSAndrew Rist
23*85596f7bSAndrew Rist
24cdf0e10cSrcweir
25cdf0e10cSrcweir<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
26cdf0e10cSrcweir    xmlns:uc="http://openoffice.org/2010/uno-components">
27cdf0e10cSrcweir  <xsl:param name="prefix"/>
28cdf0e10cSrcweir  <xsl:strip-space elements="*"/>
29cdf0e10cSrcweir  <xsl:template match="/">
30cdf0e10cSrcweir    <xsl:element name="components"
31cdf0e10cSrcweir        namespace="http://openoffice.org/2010/uno-components">
32cdf0e10cSrcweir      <xsl:for-each select="list/filename">
33cdf0e10cSrcweir        <xsl:variable name="doc" select="document(concat($prefix, .))"/>
34cdf0e10cSrcweir        <xsl:choose>
35cdf0e10cSrcweir          <xsl:when test="count($doc/uc:component) = 1">
36cdf0e10cSrcweir            <xsl:copy-of select="$doc/uc:component"/>
37cdf0e10cSrcweir          </xsl:when>
38cdf0e10cSrcweir          <xsl:otherwise>
39cdf0e10cSrcweir            <xsl:message terminate="yes">
40cdf0e10cSrcweir              <xsl:text>cannot process </xsl:text>
41cdf0e10cSrcweir              <xsl:value-of select="."/>
42cdf0e10cSrcweir            </xsl:message>
43cdf0e10cSrcweir          </xsl:otherwise>
44cdf0e10cSrcweir        </xsl:choose>
45cdf0e10cSrcweir      </xsl:for-each>
46cdf0e10cSrcweir    </xsl:element>
47cdf0e10cSrcweir  </xsl:template>
48cdf0e10cSrcweir</xsl:stylesheet>
49