xref: /aoo41x/main/officecfg/util/sanity.xsl (revision cdf0e10c)
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2
3<xsl:transform  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4		xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5		xmlns:xs="http://www.w3.org/2001/XMLSchema"
6		xmlns:oor="http://openoffice.org/2001/registry"
7		version="1.0">
8
9<xsl:output method="text" indent="no" encoding="ISO-8859-1"/>
10
11<xsl:namespace-alias stylesheet-prefix="xs" result-prefix="xs"></xsl:namespace-alias>
12
13    <!-- match root -->
14    <xsl:template match="/">
15        <xsl:apply-templates/>
16    </xsl:template>
17
18    <!-- match all elements that could possibly contain info/desc elements -->
19    <xsl:template match="group|set|node-ref|prop|enumeration|length|minLength|maxLength|minInclusive|maxInclusive|minExclusive|maxExclusive|whiteSpace">
20
21        <xsl:if test="1>string-length(info/desc)">
22            <!-- print TPF's path to current node -->
23            <xsl:message terminate="yes">
24
25                <!-- print linefeed -->
26                <xsl:text>&#10;</xsl:text>
27                <xsl:text>ERROR: No info/desc element specified or string length of info/desc element is 0.</xsl:text>
28                <xsl:text>&#10;</xsl:text>
29                <xsl:text>       There has to be a reasonable description to be specified for any item.</xsl:text>
30                <xsl:text>&#10;</xsl:text>
31
32                <xsl:text>       - path: </xsl:text>
33                <xsl:for-each select="ancestor-or-self::*"><xsl:text>/</xsl:text>
34                    <xsl:value-of select="local-name(.)"/>
35                    <xsl:choose>
36                        <xsl:when test="@oor:name">[<xsl:value-of select="@oor:name"/>]</xsl:when>
37                        <xsl:when test="@oor:value">[<xsl:value-of select="@oor:value"/>]</xsl:when>
38                    </xsl:choose>
39                </xsl:for-each>
40
41                <xsl:text>&#10;</xsl:text>
42                <xsl:text>       - author: </xsl:text>
43
44                <xsl:for-each select="ancestor-or-self::*">
45                    <!-- print element name -->
46                    <xsl:if test="info/author">
47                        <!-- print arrow -->
48                        <xsl:text>-></xsl:text>
49                        <xsl:value-of select="info/author"/>
50                    </xsl:if>
51                </xsl:for-each>
52
53            </xsl:message>
54
55        </xsl:if>
56
57        <xsl:apply-templates/>
58
59    </xsl:template>
60
61</xsl:transform>
62