diff options
author | Jörg Barfurth <jb@openoffice.org> | 2002-11-22 10:45:10 +0000 |
---|---|---|
committer | Jörg Barfurth <jb@openoffice.org> | 2002-11-22 10:45:10 +0000 |
commit | 1802befc4a3258266f84f1b62de936f32981fb84 (patch) | |
tree | cfaa46cc33890f919b8dcf7298b46dd4f0315adb /officecfg/util/alllang.xsl | |
parent | 59df57e5698f5a343ec499406bb1a2079394dc06 (diff) |
#104662# Empty values are different from NIL (in xcs=missing) values; comparison between schema and layer data is not symmetric -> renamed from isEqual to isRedundant
Diffstat (limited to 'officecfg/util/alllang.xsl')
-rw-r--r-- | officecfg/util/alllang.xsl | 47 |
1 files changed, 24 insertions, 23 deletions
diff --git a/officecfg/util/alllang.xsl b/officecfg/util/alllang.xsl index 17083866b980..6e84e594603f 100644 --- a/officecfg/util/alllang.xsl +++ b/officecfg/util/alllang.xsl @@ -3,9 +3,9 @@ * * $RCSfile: alllang.xsl,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: jb $ $Date: 2002-07-04 07:50:37 $ + * last change: $Author: jb $ $Date: 2002-11-22 11:45:10 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -185,13 +185,13 @@ </xsl:when> <xsl:when test="count (value[not (@xml:lang)])"> <!-- copy locale independent values only, if the values differ --> - <xsl:variable name="isEqual"> - <xsl:call-template name="isEqual"> - <xsl:with-param name="left" select="$context/value"/> - <xsl:with-param name="right" select="value[not (@xml:lang)]"/> + <xsl:variable name="isRedundant"> + <xsl:call-template name="isRedundant"> + <xsl:with-param name="schemaval" select="$context/value"/> + <xsl:with-param name="dataval" select="value[not (@xml:lang)]"/> </xsl:call-template> </xsl:variable> - <xsl:if test="$isEqual ='false'"> + <xsl:if test="$isRedundant ='false'"> <xsl:copy> <xsl:apply-templates select = "@*" mode="non-locale"/> <xsl:apply-templates select = "value" mode="non-locale"/> @@ -230,16 +230,26 @@ </xsl:template> <!-- compares two values --> - <xsl:template name="isEqual"> - <xsl:param name = "left"/> - <xsl:param name = "right"/> + <xsl:template name="isRedundant"> + <xsl:param name = "schemaval"/> + <xsl:param name = "dataval"/> <xsl:choose> - <xsl:when test="not ($left)"> + <xsl:when test="not ($dataval)"> + <xsl:value-of select="true()"/> + </xsl:when> + <xsl:when test="not ($schemaval)"> <xsl:choose> - <xsl:when test=" not ($right) "> + <xsl:when test="$dataval/@xsi:nil='true'"> <xsl:value-of select="true()"/> </xsl:when> - <xsl:when test="string-length ($right) = 0 and not ($right/@xsi:nil)"> + <xsl:otherwise> + <xsl:value-of select="false()"/> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + <xsl:when test="$schemaval/@xsi:nil='true'"> + <xsl:choose> + <xsl:when test="$dataval/@xsi:nil='true'"> <xsl:value-of select="true()"/> </xsl:when> <xsl:otherwise> @@ -247,16 +257,7 @@ </xsl:otherwise> </xsl:choose> </xsl:when> - <xsl:when test="not ($right)"> - <xsl:value-of select="true()"/> - </xsl:when> - <xsl:when test="$left/@xsi:nil='true' and $right/@xsi:nil='true'"> - <xsl:value-of select="true()"/> - </xsl:when> - <xsl:when test="$left/@xsi:nil or $right/@xsi:nil"> - <xsl:value-of select="false()"/> - </xsl:when> - <xsl:when test="$left = $right"> + <xsl:when test="$schemaval = $dataval"> <xsl:value-of select="true()"/> </xsl:when> <xsl:otherwise> |