sync master with lastest vba changes
[ooovba.git] / officecfg / util / resource.xsl
blob3343808fb49bf280f62824067c11e3bb79683aea
1 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2 <!--***********************************************************************
4 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 Copyright 2008 by Sun Microsystems, Inc.
8 OpenOffice.org - a multi-platform office productivity suite
10 $RCSfile: resource.xsl,v $
12 $Revision: 1.4 $
14 This file is part of OpenOffice.org.
16 OpenOffice.org is free software: you can redistribute it and/or modify
17 it under the terms of the GNU Lesser General Public License version 3
18 only, as published by the Free Software Foundation.
20 OpenOffice.org is distributed in the hope that it will be useful,
21 but WITHOUT ANY WARRANTY; without even the implied warranty of
22 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 GNU Lesser General Public License version 3 for more details
24 (a copy is included in the LICENSE file that accompanied this code).
26 You should have received a copy of the GNU Lesser General Public License
27 version 3 along with OpenOffice.org. If not, see
28 <http://www.openoffice.org/license.html>
29 for a copy of the LGPLv3 License.
31 ************************************************************************ -->
33 <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
34 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
35 xmlns:xs="http://www.w3.org/2001/XMLSchema"
36 xmlns:oor="http://openoffice.org/2001/registry"
37 version="1.0">
39 <!-- Set correct output format -->
40 <xsl:output method="text" indent="no" encoding="UTF-8"/>
42 <xsl:param name="locale"/>
43 <xsl:param name="fallback-locale">en-US</xsl:param>
45 <xsl:namespace-alias stylesheet-prefix="xs" result-prefix="xs"></xsl:namespace-alias>
47 <!-- overwrite default rule for text & attribute nodes to be silent -->
48 <xsl:template match="text()|@*">
49 </xsl:template>
51 <!-- match root -->
52 <xsl:template match="/">
53 <xsl:apply-templates/>
54 </xsl:template>
56 <!-- match all elements that could possibly contain info elements -->
57 <xsl:template match="info/desc[@xml:lang=$locale]|info/label[@xml:lang=$locale]">
59 <!-- print TPF's path to current node -->
60 <xsl:for-each select="ancestor-or-self::*">
61 <xsl:if test="local-name(.)!='component-schema'"><xsl:value-of select="local-name(.)"/>
62 <xsl:choose>
63 <xsl:when test="@oor:name">[<xsl:value-of select="@oor:name"/>]</xsl:when>
64 <xsl:when test="@oor:value">[<xsl:value-of select="@oor:value"/>]</xsl:when>
65 </xsl:choose>
66 <xsl:if test="position()!=last()">.</xsl:if>
67 </xsl:if>
68 </xsl:for-each>
70 <!-- print separator (equals sign) -->
71 <xsl:text>=</xsl:text>
73 <!-- print info/desc|label element's content -->
74 <xsl:value-of select="normalize-space(.)"/>
76 <!-- print linefeed -->
77 <xsl:text>&#10;</xsl:text>
79 <xsl:apply-templates/>
81 </xsl:template>
83 </xsl:transform>