From 1348786d3f48f7518106975a0302bb66831c5525 Mon Sep 17 00:00:00 2001 From: Jens Kupferschmidt <kupferschmidt@rz.uni-leipzig.de> Date: Sun, 15 Nov 2020 18:08:36 +0100 Subject: [PATCH] fix bug --- src/main/resources/xsl/biocol2native.xsl | 42 ++++++++++++++++-------- src/main/resources/xsl/biocol2xml.xsl | 42 ++++++++++++++++-------- 2 files changed, 56 insertions(+), 28 deletions(-) diff --git a/src/main/resources/xsl/biocol2native.xsl b/src/main/resources/xsl/biocol2native.xsl index 0306442..5c83ce7 100644 --- a/src/main/resources/xsl/biocol2native.xsl +++ b/src/main/resources/xsl/biocol2native.xsl @@ -20,11 +20,15 @@ <xsl:when test="name() = 'def.biocol02'"> <xsl:apply-templates select="." mode="classification-native" /> </xsl:when> - <xsl:when test="name() = 'def.biocol04' and $accessintern = 'true'"> - <xsl:copy-of select="." /> + <xsl:when test="name() = 'def.biocol04'"> + <xsl:if test="$accessintern = 'true'"> + <xsl:copy-of select="." /> + </xsl:if> </xsl:when> - <xsl:when test="name() = 'def.biocol05' and $accessintern = 'true'"> - <xsl:copy-of select="." /> + <xsl:when test="name() = 'def.biocol05'"> + <xsl:if test="$accessintern = 'true'"> + <xsl:copy-of select="." /> + </xsl:if> </xsl:when> <xsl:when test="name() = 'def.biocol07'"> <xsl:apply-templates select="." mode="classification-native" /> @@ -35,20 +39,30 @@ <xsl:when test="name() = 'def.biocol16'"> <xsl:apply-templates select="." mode="classification-native" /> </xsl:when> - <xsl:when test="name() = 'def.biocol80' and $accessintern = 'true'"> - <xsl:copy-of select="." /> + <xsl:when test="name() = 'def.biocol80'"> + <xsl:if test="$accessintern = 'true'"> + <xsl:copy-of select="." /> + </xsl:if> </xsl:when> - <xsl:when test="name() = 'def.biocol81' and $accessintern = 'true'"> - <xsl:copy-of select="." /> + <xsl:when test="name() = 'def.biocol81'"> + <xsl:if test="$accessintern = 'true'"> + <xsl:copy-of select="." /> + </xsl:if> </xsl:when> - <xsl:when test="name() = 'def.biocol82' and $accessintern = 'true'"> - <xsl:copy-of select="." /> + <xsl:when test="name() = 'def.biocol82'"> + <xsl:if test="$accessintern = 'true'"> + <xsl:copy-of select="." /> + </xsl:if> </xsl:when> - <xsl:when test="name() = 'def.biocol83' and $accessintern = 'true'"> - <xsl:copy-of select="." /> + <xsl:when test="name() = 'def.biocol83'"> + <xsl:if test="$accessintern = 'true'"> + <xsl:copy-of select="." /> + </xsl:if> </xsl:when> - <xsl:when test="name() = 'def.biocol84' and $accessintern = 'true'"> - <xsl:copy-of select="." /> + <xsl:when test="name() = 'def.biocol84'"> + <xsl:if test="$accessintern = 'true'"> + <xsl:copy-of select="." /> + </xsl:if> </xsl:when> <xsl:when test="name() = 'def.biocol97'"> <xsl:apply-templates select="." mode="classification-native" /> diff --git a/src/main/resources/xsl/biocol2xml.xsl b/src/main/resources/xsl/biocol2xml.xsl index 4f34b7a..c7e0961 100644 --- a/src/main/resources/xsl/biocol2xml.xsl +++ b/src/main/resources/xsl/biocol2xml.xsl @@ -17,26 +17,40 @@ <xsl:choose> <xsl:when test="$access = 'true'"> <xsl:choose> - <xsl:when test="name() = 'def.biocol04' and $accessintern = 'true'"> - <xsl:copy-of select="." /> + <xsl:when test="name() = 'def.biocol04'"> + <xsl:if test="$accessintern = 'true'"> + <xsl:copy-of select="." /> + </xsl:if> </xsl:when> - <xsl:when test="name() = 'def.biocol05' and $accessintern = 'true'"> - <xsl:copy-of select="." /> + <xsl:when test="name() = 'def.biocol05'"> + <xsl:if test="$accessintern = 'true'"> + <xsl:copy-of select="." /> + </xsl:if> </xsl:when> - <xsl:when test="name() = 'def.biocol80' and $accessintern = 'true'"> - <xsl:copy-of select="." /> + <xsl:when test="name() = 'def.biocol80'"> + <xsl:if test="$accessintern = 'true'"> + <xsl:copy-of select="." /> + </xsl:if> </xsl:when> - <xsl:when test="name() = 'def.biocol81' and $accessintern = 'true'"> - <xsl:copy-of select="." /> + <xsl:when test="name() = 'def.biocol81'"> + <xsl:if test="$accessintern = 'true'"> + <xsl:copy-of select="." /> + </xsl:if> </xsl:when> - <xsl:when test="name() = 'def.biocol82' and $accessintern = 'true'"> - <xsl:copy-of select="." /> + <xsl:when test="name() = 'def.biocol82'"> + <xsl:if test="$accessintern = 'true'"> + <xsl:copy-of select="." /> + </xsl:if> </xsl:when> - <xsl:when test="name() = 'def.biocol83' and $accessintern = 'true'"> - <xsl:copy-of select="." /> + <xsl:when test="name() = 'def.biocol83'"> + <xsl:if test="$accessintern = 'true'"> + <xsl:copy-of select="." /> + </xsl:if> </xsl:when> - <xsl:when test="name() = 'def.biocol84' and $accessintern = 'true'"> - <xsl:copy-of select="." /> + <xsl:when test="name() = 'def.biocol84'"> + <xsl:if test="$accessintern = 'true'"> + <xsl:copy-of select="." /> + </xsl:if> </xsl:when> <xsl:otherwise> <xsl:copy-of select="." /> -- GitLab