Created
February 8, 2018 21:07
-
-
Save JakubMifek/663a751a8d41fc3d46d8971cdf9ad593 to your computer and use it in GitHub Desktop.
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="windows-1250" ?> | |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
<xsl:output method="xml"/> | |
<xsl:template match="/"> | |
<xsl:apply-templates/> | |
</xsl:template> | |
<xsl:template match="panovnici"> | |
<kings> | |
<xsl:apply-templates/> | |
</kings> | |
</xsl:template> | |
<xsl:template match="panovnik"> | |
<king jmeno="{./jmeno}" od="{./panoval/od}" do="{./panoval/do}"> | |
<xsl:call-template name="detail"> | |
<xsl:with-param name="od" select="number(panoval/od)-1"/> | |
<xsl:with-param name="do" select="number(panoval/do)+1"/> | |
</xsl:call-template> | |
</king> | |
</xsl:template> | |
<xsl:template name="detail"> | |
<xsl:param name="od"/> | |
<xsl:param name="do"/> | |
<xsl:variable name="events" select="doc('udalosti.xml')"/> | |
<xsl:for-each select="$events/udalosti/udalost"> | |
<xsl:variable name="rok" select="number(@rok)"/> | |
<xsl:if test="$od < $rok and $rok < $do"> | |
<udalost rok="{$rok}"> | |
<xsl:value-of select="text()"/> | |
</udalost> | |
</xsl:if> | |
</xsl:for-each> | |
</xsl:template> | |
</xsl:stylesheet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment