xref: /trunk/main/officecfg/util/sanity.xsl (revision 8eb6fccd)
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<!--***********************************************************
3 *
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements.  See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership.  The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License.  You may obtain a copy of the License at
11 *
12 *   http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied.  See the License for the
18 * specific language governing permissions and limitations
19 * under the License.
20 *
21 ***********************************************************-->
22
23<xsl:transform  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
24		xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
25		xmlns:xs="http://www.w3.org/2001/XMLSchema"
26		xmlns:oor="http://openoffice.org/2001/registry"
27		version="1.0">
28
29<xsl:output method="text" indent="no" encoding="ISO-8859-1"/>
30
31<xsl:namespace-alias stylesheet-prefix="xs" result-prefix="xs"></xsl:namespace-alias>
32
33    <!-- match root -->
34    <xsl:template match="/">
35        <xsl:apply-templates/>
36    </xsl:template>
37
38    <!-- match all elements that could possibly contain info/desc elements -->
39    <xsl:template match="group|set|node-ref|prop|enumeration|length|minLength|maxLength|minInclusive|maxInclusive|minExclusive|maxExclusive|whiteSpace">
40
41        <xsl:if test="1>string-length(info/desc)">
42            <!-- print TPF's path to current node -->
43            <xsl:message terminate="yes">
44
45                <!-- print linefeed -->
46                <xsl:text>&#10;</xsl:text>
47                <xsl:text>ERROR: No info/desc element specified or string length of info/desc element is 0.</xsl:text>
48                <xsl:text>&#10;</xsl:text>
49                <xsl:text>       There has to be a reasonable description to be specified for any item.</xsl:text>
50                <xsl:text>&#10;</xsl:text>
51
52                <xsl:text>       - path: </xsl:text>
53                <xsl:for-each select="ancestor-or-self::*"><xsl:text>/</xsl:text>
54                    <xsl:value-of select="local-name(.)"/>
55                    <xsl:choose>
56                        <xsl:when test="@oor:name">[<xsl:value-of select="@oor:name"/>]</xsl:when>
57                        <xsl:when test="@oor:value">[<xsl:value-of select="@oor:value"/>]</xsl:when>
58                    </xsl:choose>
59                </xsl:for-each>
60
61                <xsl:text>&#10;</xsl:text>
62                <xsl:text>       - author: </xsl:text>
63
64                <xsl:for-each select="ancestor-or-self::*">
65                    <!-- print element name -->
66                    <xsl:if test="info/author">
67                        <!-- print arrow -->
68                        <xsl:text>-></xsl:text>
69                        <xsl:value-of select="info/author"/>
70                    </xsl:if>
71                </xsl:for-each>
72
73            </xsl:message>
74
75        </xsl:if>
76
77        <xsl:apply-templates/>
78
79    </xsl:template>
80
81</xsl:transform>
82