Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions mycore-base/src/main/resources/xslt/functions/classification.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@
<xsl:when test="$class[@classid and @categid]">
<xsl:sequence select="mcrclass:label($lang, document(concat('classification:metadata:0:children:',$class/@classid,':',$class/@categid))//category)" />
</xsl:when>
<xsl:when test="string-length($lang) > 0 and $class/label[lang($lang)]">
<xsl:sequence select="$class/label[lang($lang)]" />
<xsl:when test="string-length($lang) > 0 and $class/label[@xml:lang = $lang]">
<xsl:sequence select="$class/label[@xml:lang = $lang]" />
</xsl:when>
<xsl:when test="$class/label[lang($CurrentLang)]">
<xsl:sequence select="$class/label[lang($CurrentLang)]" />
<xsl:when test="$class/label[@xml:lang = $CurrentLang]">
<xsl:sequence select="$class/label[@xml:lang = $CurrentLang]" />
</xsl:when>
<xsl:when test="$class/label[lang($DefaultLang)]">
<xsl:sequence select="$class/label[lang($DefaultLang)]" />
<xsl:when test="$class/label[@xml:lang = $DefaultLang]">
<xsl:sequence select="$class/label[@xml:lang = $DefaultLang]" />
</xsl:when>
<xsl:otherwise>
<xsl:sequence select="$class/label[1]" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public void testCategory() throws Exception {
// existing classification: return category with respective labels
assertEquals(1, result.getChildren("category").size());
assertEquals("junit_1", result.getChild("category").getAttributeValue("ID"));
assertEquals(3, result.getChild("category").getChildren("label").size());
assertEquals(4, result.getChild("category").getChildren("label").size());
assertEquals("de",
result.getChild("category").getChildren("label").get(0).getAttributeValue("lang", Namespace.XML_NAMESPACE));
assertEquals("junit_1 (de)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<label xml:lang="de" text="junit_1 (de)"/>
<label xml:lang="en" text="junit_1 (en)"/>
<label xml:lang="x-xxx" text="abc"/>
<label xml:lang="x-xxx-abc" text="def"/>
</category>
<category ID="junit_2">
<label xml:lang="en" text="junit_2 (en)"/>
Expand Down
Loading