Both sides previous revision
Poprzednia wersja
|
Nowa wersja
Both sides next revision
|
pl:miw:miw08_xtt_rif:verb [2008/03/31 16:00] miw skaldnia |
pl:miw:miw08_xtt_rif:verb [2008/04/22 17:13] miw nowy arkusz |
| |
<xsl:stylesheet version = '1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'> | <xsl:stylesheet version = '1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'> |
<xsl:template match="/"> | <xsl:template match="Group"> |
<xsl:for-each select="Ruleset/rule"> | < html>< body> |
If | <xsl:for-each select="./sentence"> |
| If |
<xsl:choose> | <xsl:choose> |
<xsl:when test="./formula/Implies/if/Or"> | <xsl:when test="./Implies/if/Or"> |
<xsl:for-each select="./formula/Implies/if/Or/formula"> | <xsl:for-each select="./Implies/if/Or/formula"> |
<xsl:choose> | <xsl:choose> |
<xsl:when test="./Equal"> | <xsl:when test="./Equal"> |
<b><xsl:value-of select="./Equal/arg/Var"/></b> is <b><xsl:value-of select="./Equal/arg/Const"/></b> | <b><xsl:value-of select="./Equal/side/Var"/></b> is <b><xsl:value-of select="./Equal/side/Const"/></b> |
</xsl:when> | </xsl:when> |
<xsl:when test="./Uniterm"> | <xsl:when test="./Atom"> |
<b><xsl:value-of select="./Uniterm/op/Const"/>(</b> | <xsl:apply-templates select="./Atom"/> is true |
<xsl:for-each select="./Uniterm/arg"> | </xsl:when> |
<xsl:choose> | <xsl:when test="./External"> |
<xsl:when test="./Var"> | External <xsl:apply-templates select="./External/content/Expr|./External/content/Atom"/> is true |
var <b><xsl:value-of select="./Var"/></b> | |
</xsl:when> | |
<xsl:otherwise> | |
<xsl:value-of select="./Const"/> | |
</xsl:otherwise> | |
</xsl:choose> | |
<xsl:if test="position() != last()"> | |
, | |
</xsl:if> | |
</xsl:for-each> | |
<b>)</b> is true | |
</xsl:when> | </xsl:when> |
</xsl:choose> | </xsl:choose> |
</xsl:for-each> | </xsl:for-each> |
</xsl:when> | </xsl:when> |
<xsl:when test="./formula/Implies/if/And"> | <xsl:when test="./Implies/if/And"> |
<xsl:for-each select="./formula/Implies/if/And/formula"> | <xsl:for-each select="./Implies/if/And/formula"> |
<xsl:choose> | <xsl:choose> |
<xsl:when test="./Equal"> | <xsl:when test="./Equal"> |
<b><xsl:value-of select="./Equal/arg/Var"/></b> is <b><xsl:value-of select="./Equal/arg/Const"/></b> | <b><xsl:value-of select="./Equal/side/Var"/></b> is <b><xsl:value-of select="./Equal/side/Const"/></b> |
</xsl:when> | </xsl:when> |
<xsl:when test="./Uniterm"> | <xsl:when test="./Atom"> |
<b><xsl:value-of select="./Uniterm/op/Const"/>(</b> | <xsl:apply-templates select="./Atom"/> is true |
<xsl:for-each select="./Uniterm/arg"> | </xsl:when> |
<xsl:choose> | <xsl:when test="./External"> |
<xsl:when test="./Var"> | External <xsl:apply-templates select="./External/content/Expr|./External/content/Atom"/> is true |
var <b><xsl:value-of select="./Var"/></b> | |
</xsl:when> | |
<xsl:otherwise> | |
<xsl:value-of select="./Const"/> | |
</xsl:otherwise> | |
</xsl:choose> | |
<xsl:if test="position() != last()"> | |
, | |
</xsl:if> | |
</xsl:for-each> | |
<b>)</b> is true | |
</xsl:when> | </xsl:when> |
</xsl:choose> | </xsl:choose> |
<xsl:otherwise> | <xsl:otherwise> |
<xsl:choose> | <xsl:choose> |
<xsl:when test="./formula/Implies/if/formula/Equal"> | <xsl:when test="./Implies/if/Equal"> |
<b><xsl:value-of select="./formula/Implies/if/formula/Equal/arg/Var"/></b> is <b><xsl:value-of select="./formula/Implies/if/formula/Equal/arg/Const"/></b> | <b><xsl:value-of select="./Implies/if/formula/Equal/side/Var"/></b> is <b><xsl:value-of select="./Implies/if/formula/Equal/side/Const"/></b> |
</xsl:when> | </xsl:when> |
<xsl:when test="./formula/Implies/if/formula/Uniterm"> | <xsl:when test="./Implies/if/Atom"> |
<b><xsl:value-of select="./formula/Implies/if/formula/Uniterm/op/Const"/>(</b> | <xsl:apply-templates select="./Implies/if/Atom"/> is true |
<xsl:for-each select="./formula/Implies/if/formula/Uniterm/arg"> | </xsl:when> |
<xsl:choose> | <xsl:when test="./Implies/if/External"> |
<xsl:when test="./Var"> | <xsl:apply-templates select="./Implies/if/External/content/Atom|./Implies/if/formula/External/content/Expr"/> is true |
var <b><xsl:value-of select="./Var"/></b> | |
</xsl:when> | |
<xsl:otherwise> | |
<xsl:value-of select="./Const"/> | |
</xsl:otherwise> | |
</xsl:choose> | |
<xsl:if test="position() != last()"> | |
, | |
</xsl:if> | |
</xsl:for-each> | |
<b>)</b> is true | |
</xsl:when> | </xsl:when> |
</xsl:choose> | </xsl:choose> |
</xsl:otherwise> | </xsl:otherwise> |
</xsl:choose> | </xsl:choose> |
then <b><xsl:value-of select="./formula/Implies/then/Uniterm/arg/*"/></b> is <b><xsl:value-of select="./formula/Implies/then/Uniterm/op/Const"/></b>.<br/> | <xsl:choose> |
| <xsl:when test="./Implies/then/Atom"> |
| then assert <xsl:apply-templates select="./Implies/then/Atom"/>.<br/> |
| </xsl:when> |
| <xsl:when test="./Implies/then/External"> |
| then assert External <xsl:apply-templates select="./Implies/then/External/content/Expr|./Implies/then/External/content/Atom"/>.<br/> |
| </xsl:when> |
| </xsl:choose> |
</xsl:for-each> | </xsl:for-each> |
| < /body> |
| < /html> |
| </xsl:template> |
| |
| <xsl:template match="arg"> |
| <xsl:choose> |
| <xsl:when test="./Var"> |
| var <xsl:value-of select="./Var"/> |
| </xsl:when> |
| <xsl:when test="./Const"> |
| <xsl:value-of select="./Const"/> |
| </xsl:when> |
| <xsl:when test="./External/content"> |
| External <xsl:apply-templates select="./External/content/Expr|./External/content/Atom"/> |
| </xsl:when> |
| <xsl:when test="./Atom"> |
| <xsl:apply-templates select="./Atom"/> |
| </xsl:when> |
| </xsl:choose> |
| </xsl:template> |
| |
| <xsl:template match="Atom"> |
| <xsl:for-each select="./*"> |
| <xsl:choose> |
| <xsl:when test="name() = 'op'"> |
| <b><xsl:value-of select="./Const"/>(</b> |
| </xsl:when> |
| <xsl:otherwise> |
| <xsl:apply-templates select="."/> |
| <xsl:if test="position() != last()">, </xsl:if> |
| </xsl:otherwise> |
| </xsl:choose> |
| </xsl:for-each> |
| <b>)</b> |
| </xsl:template> |
| |
| <xsl:template match="Expr"> |
| <xsl:for-each select="./*"> |
| <xsl:choose> |
| <xsl:when test="./Const"> |
| <b><xsl:value-of select="./Const"/>(</b> |
| </xsl:when> |
| <xsl:otherwise> |
| <xsl:apply-templates select="."/> |
| <xsl:if test="position() != last()">, </xsl:if> |
| </xsl:otherwise> |
| </xsl:choose> |
| </xsl:for-each> |
| <b>)</b> |
</xsl:template> | </xsl:template> |
| |
</xsl:stylesheet> | </xsl:stylesheet> |
</code> | </code> |
[[pl:miw:miw08_xtt_rif|Powrót do dokumentu]] | [[pl:miw:miw08_xtt_rif|Powrót do dokumentu]] |