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