ZJJX-Zadanie2/Poeci.xsl
2020-05-18 10:48:51 +02:00

61 lines
1.2 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:template match="/CollectionOfPoems">
<html>
<head>
<style>
div h2 {
display: inline-block;
}
.title {
font-style: italic;
}
.verse {
margin: 0;
}
</style>
</head>
<body>
<h1>Zbiór Wierszy</h1>
<xsl:apply-templates select="Poem"/>
</body>
</html>
</xsl:template>
<xsl:template match="Poem">
<div>
<h2><xsl:value-of select="Author/FirstName"/></h2>
<h2><xsl:value-of select="Author/LastName"/></h2>
<h2> - </h2>
<h2 class="title"><xsl:value-of select="Title"/></h2>
<xsl:if test="Subtitle">
<h2 class="title">(<xsl:value-of select="Subtitle"/>)</h2>
</xsl:if>
</div>
<xsl:apply-templates select="Strophe"/>
</xsl:template>
<xsl:template match="Strophe">
<p>
<xsl:apply-templates select="Verse"/>
</p>
</xsl:template>
<xsl:template match="Verse">
<p class="verse">
<xsl:apply-templates/>
</p>
</xsl:template>
<xsl:template match="Bold">
<b>
<xsl:apply-templates/>
</b>
</xsl:template>
</xsl:stylesheet>