Last active
December 18, 2019 10:29
-
-
Save memowe/80653c4f1362d450a31536e52bafc366 to your computer and use it in GitHub Desktop.
eXiStentiaLisT test resources
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<qa> | |
<question lang="en">What is the answer to the ultimate question of life, the universe, and everything?</question> | |
<question lang="de">Wie lautet die antwort auf die Frage nach dem Leben, dem Universum und dem ganzen Rest?</question> | |
<answer>42</answer> | |
</qa> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
xmlns:xs="http://www.w3.org/2001/XMLSchema" | |
exclude-result-prefixes="xs" | |
version="2.0"> | |
<xsl:template match="emph"> | |
<i> | |
<xsl:value-of select="."/> | |
</i> | |
</xsl:template> | |
</xsl:stylesheet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
<xsl:output indent="yes" encoding="UTF-8" html-version="5" media-type="text/html" omit-xml-declaration="yes"/> | |
<xsl:param name="lang">en</xsl:param> | |
<xsl:template match="/"> | |
<html lang="{$lang}"> | |
<head> | |
<title>Q & A</title> | |
</head> | |
<body> | |
<h1>Q & A</h1> | |
<xsl:apply-templates select="qa/question[@lang eq $lang]"/> | |
<br/> | |
<xsl:apply-templates select="qa/answer"/> | |
</body> | |
</html> | |
</xsl:template> | |
<xsl:template match="question[@lang eq 'en']"> | |
<strong>Question</strong>: <xsl:value-of select="."/> | |
</xsl:template> | |
<xsl:template match="question[@lang eq 'de']"> | |
<strong>Frage</strong>: <xsl:value-of select="."/> | |
</xsl:template> | |
<xsl:template match="answer"> | |
<xsl:choose> | |
<xsl:when test="$lang eq 'en'"><strong>Answer</strong>: </xsl:when> | |
<xsl:when test="$lang eq 'de'"><strong>Antwort</strong>: </xsl:when> | |
</xsl:choose> | |
<xsl:value-of select="."/> | |
</xsl:template> | |
</xsl:stylesheet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment