Commit 1ed23d98 authored by Dennis Neumann's avatar Dennis Neumann
Browse files

Add languages to single pages

parent d0a755b4
......@@ -311,6 +311,11 @@ Refer to comments in the code to understand the used algorithm.
</div>
<xsl:text disable-output-escaping="yes">]]&gt;</xsl:text>
</field>
<xsl:for-each select="distinct-values(//@xml:lang)">
<field name="language">
<xsl:value-of select="." />
</field>
</xsl:for-each>
</doc>
</xsl:if>
</xsl:for-each-group>
......
......@@ -51,6 +51,13 @@ public class XsltTest {
assertXpathEvaluatesTo("eng", "//field[@name='language'][2]", result);
}
@Test
public void languageOnPage() throws Exception {
String result = transform("language.xml");
assertXpathEvaluatesTo("ger", "//field[text()='page']/../field[@name='language']", result);
}
@Test
public void oneLanguage() throws Exception {
String result = transform("language.xml");
......
......@@ -5,6 +5,7 @@
<text xml:id="my_id" xml:lang="ger">
<body>
<div>
<pb />
<p>Test text.</p>
</div>
</body>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment