<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:wl="http://wolnelektury.pl/functions"
- xmlns:dc="http://purl.org/dc/elements/1.1/" >
+ xmlns:dc="http://purl.org/dc/elements/1.1/">
<xsl:output encoding="utf-8" indent="yes" omit-xml-declaration = "yes" version="2.0" />
<xsl:template match="section">
<xsl:copy><xsl:apply-templates /></xsl:copy>
</xsl:template>
-<xsl:template match="metadata"></xsl:template>
-<xsl:template match="aside"></xsl:template>
+<xsl:template match="metadata"/>
+<xsl:template match="aside">
+ <xsl:if test="@class = 'gap'">
+ <luka><xsl:apply-templates/></luka>
+ </xsl:if>
+</xsl:template>
<xsl:template match="header">
<xsl:when test="@class = 'list.itemized'">
<lista typ="punkt"><xsl:apply-templates /></lista>
</xsl:when>
+ <xsl:when test="@class = 'list.orderable'">
+ <lista typ="punkt"><xsl:apply-templates /></lista>
+ </xsl:when>
<xsl:when test="@class = 'list.enum'">
<lista typ="num"><xsl:apply-templates /></lista>
</xsl:when>
<xsl:when test="@class = 'item'">
<punkt><xsl:apply-templates /></punkt>
</xsl:when>
+ <xsl:when test="@class = 'item.answer'">
+ <xsl:element name="punkt">
+ <xsl:attribute name="rozw">
+ <xsl:choose>
+ <xsl:when test="@answer = 'true'">prawda</xsl:when>
+ <xsl:when test="@answer = 'false'">falsz</xsl:when>
+ <xsl:otherwise><xsl:value-of select="@answer" /></xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ <xsl:apply-templates />
+ </xsl:element>
+ </xsl:when>
<xsl:when test="@class = 'defined'">
<xsl:choose>
<xsl:when test="count(ancestor::*) = 4 ">
</xsl:when>
<xsl:when test="@class = 'exercise.order'">
<cwiczenie typ="uporzadkuj">
- <xsl:for-each select="div">
- <xsl:choose>
- <xsl:when test="@class = 'p'">
- <opis><akap><xsl:value-of select="."/></akap></opis>
- </xsl:when>
- <xsl:when test="@class = 'list.orderable'">
- <lista typ="punkt">
- <xsl:apply-templates select="div" mode="exercise.order.list"/>
- </lista>
- </xsl:when>
- </xsl:choose>
- </xsl:for-each>
+ <xsl:call-template name="cwiczenie"/>
</cwiczenie>
</xsl:when>
<xsl:when test="@class = 'exercise.choice.true-or-false'">
<cwiczenie typ="prawdafalsz">
- <xsl:for-each select="div">
- <xsl:choose>
- <xsl:when test="@class = 'p'">
- <opis><akap><xsl:value-of select="."/></akap></opis>
- </xsl:when>
- <xsl:when test="@class = 'list'">
- <lista typ="punkt">
- <xsl:apply-templates select="div" mode="exercise.true-or-false"/>
- </lista>
- </xsl:when>
- </xsl:choose>
- </xsl:for-each>
+ <xsl:call-template name="cwiczenie"/>
+ </cwiczenie>
+ </xsl:when>
+ <xsl:when test="@class = 'exercise.choice' or @class = 'exercise.choice.single'">
+ <cwiczenie typ="wybor">
+ <opis><akap>[opis]</akap></opis>
+ <lista typ="num">
+ <punkt>
+ <pytanie>
+ <xsl:for-each select="div">
+ <xsl:choose>
+ <xsl:when test="@class = 'p'">
+ <xsl:apply-templates />
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates select="."/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </pytanie>
+ </punkt>
+ </lista>
+ </cwiczenie>
+ </xsl:when>
+ <xsl:when test="@class = 'exercise.gap'">
+ <cwiczenie typ="luki">
+ <opis><akap>Uzupełnij luki:</akap></opis>
+ <xsl:apply-templates/>
+ </cwiczenie>
+ </xsl:when>
+ <xsl:when test="@class = 'exercise.replace'">
+ <cwiczenie typ="zastap">
+ <opis><akap>Znajdź i zamień niepasujące słowa w zdaniach na następujące:</akap></opis>
+ <xsl:apply-templates/>
</cwiczenie>
</xsl:when>
<xsl:otherwise>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="url">
- <xsl:value-of select="text()" />
+ <xsl:value-of select="." />
</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<xsl:when test="@class = 'cite'">
<dlugi_cytat><xsl:apply-templates /></dlugi_cytat>
</xsl:when>
+ <xsl:when test="@class = 'answer'">
+ <zastap rozw="{@answer}"><xsl:apply-templates/></zastap>
+ </xsl:when>
<xsl:otherwise>
<NIEZNANY_SPAN><xsl:value-of select="@class" /></NIEZNANY_SPAN>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
-<xsl:template match="div" mode="exercise.order.list">
- <punkt rozw="{@answer}"><xsl:value-of select="."/></punkt>
+<xsl:template match="section" mode="error">
+ NIEZNANA_SEKCJA
</xsl:template>
-<xsl:template match="div" mode="exercise.true-or-false">
- <xsl:element name="punkt">
+<xsl:template name="cwiczenie">
+ <xsl:for-each select="div">
<xsl:choose>
- <xsl:when test="@answer = 'true'">
- <xsl:attribute name="rozw">prawda</xsl:attribute>
- </xsl:when>
- <xsl:when test="@answer = 'false'">
- <xsl:attribute name="rozw">falsz</xsl:attribute>
+ <xsl:when test="@class = 'p'">
+ <opis><xsl:apply-templates select="."/></opis>
</xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates select="."/>
+ </xsl:otherwise>
</xsl:choose>
- <xsl:value-of select="."/>
- </xsl:element>
-</xsl:template>
-
-<xsl:template match="section" mode="error">
- NIEZNANA_SEKCJA
+ </xsl:for-each>
</xsl:template>
</xsl:stylesheet>