summaryrefslogtreecommitdiff
path: root/officecfg
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2013-10-05 17:29:05 +0200
committerStephan Bergmann <sbergman@redhat.com>2013-10-05 18:54:45 +0200
commit30fd40e42305069eb52eb4b47acf869d91c21ee5 (patch)
tree48d4565b38fc155e3c7e1ef5438222d66191626c /officecfg
parentaced29f305a25fba8f8a968599f4b4ba226b7098 (diff)
Improve prop value checks
Change-Id: Iee877c5d4ca384a19302fe2a1fc2837325bfd604
Diffstat (limited to 'officecfg')
-rw-r--r--officecfg/util/data_val.xsl35
1 files changed, 21 insertions, 14 deletions
diff --git a/officecfg/util/data_val.xsl b/officecfg/util/data_val.xsl
index fcd7a16a7162..cd2f10e87437 100644
--- a/officecfg/util/data_val.xsl
+++ b/officecfg/util/data_val.xsl
@@ -182,21 +182,28 @@
<!-- ****************************************** -->
<xsl:template match="value">
<xsl:call-template name="checkModule"/>
-
- <xsl:if test="@install:module">
- <xsl:variable name = "path">
- <xsl:call-template name="collectPath"/>
- </xsl:variable>
- <xsl:variable name = "module" select="@install:module"/>
- <xsl:variable name = "lang" select="@xml:lang"/>
-
- <xsl:if test="following-sibling::value[@install:module=$module and @xml:lang=$lang]">
- <xsl:message terminate="yes">ERROR: Property '<xsl:value-of select="$path"/>' has multiple values for module <xsl:value-of select="$module"/> and locale <xsl:value-of select="$lang"/>!</xsl:message>
- </xsl:if>
- <xsl:if test="not(preceding-sibling::value/@install:module)">
- <xsl:message>ATTENTION: Property '<xsl:value-of select="$path"/>' has different values for different modules. Make sure the modules are mutually exclusive!</xsl:message>
- </xsl:if>
+ <xsl:variable name="path">
+ <xsl:call-template name="collectPath"/>
+ </xsl:variable>
+ <xsl:variable name="lang" select="@xml:lang"/>
+ <xsl:variable name="module" select="@install:module"/>
+ <xsl:if test="$module and $lang='x-no-translate'">
+ <xsl:message terminate="yes">ERROR: Property '<xsl:value-of select="$path"/>' has value for special xml:lang="x-no-translate" in module <xsl:value-of select="$module"/>.</xsl:message>
</xsl:if>
+ <xsl:choose>
+ <xsl:when
+ test="preceding-sibling::value[($lang and not(@xml:lang)) or (not($lang) and @xml:lang)]">
+ <xsl:message terminate="yes">ERROR: Property '<xsl:value-of select="$path"/>' has values with and without xml:lang attributes.</xsl:message>
+ </xsl:when>
+ <xsl:when
+ test="preceding-sibling::value[((not($lang) and not(@xml:lang)) or $lang=@xml:lang) and ((not($module) and not(@install:module)) or $module=@install:module)]">
+ <xsl:message terminate="yes">ERROR: Property '<xsl:value-of select="$path"/>' has values with matching xml:lang attribute <xsl:value-of select="$lang"/> and inconsistent install:module attributes.</xsl:message>
+ </xsl:when>
+ <xsl:when
+ test="preceding-sibling::value[((not($lang) and not(@xml:lang)) or $lang=@xml:lang) and (($module and not(@install:module)) or (not($module) and @install:module) or $module!=@install:module)]">
+ <xsl:message>ATTENTION: Property '<xsl:value-of select="$path"/>' has different values for different modules. Make sure the modules are mutually exclusive!</xsl:message>
+ </xsl:when>
+ </xsl:choose>
</xsl:template>
<!-- ****************************************** -->