Both sides previous revision
Poprzednia wersja
Nowa wersja
|
Poprzednia wersja
|
pl:miw:miw08_xtt_rif:visual [2008/03/28 21:25] miw |
pl:miw:miw08_xtt_rif:visual [2019/06/27 15:50] (aktualna) |
< html> | < html> |
<head> | <head> |
<title>Ruleset Visualisation</title> | <title>RIF Visualisation</title> |
</head> | </head> |
< body> | < body> |
<div style="border: 1px solid #ff8400; background-color: #ffd45f; padding: 5px 5px 5px 5px;"> | <div style="border: 1px solid #ff8400; background-color: #ffd45f; padding: 5px 5px 5px 5px;"> |
<div style="font-size: 25px; font-family: Verdana, Sans; font-weight: bold; padding: 0px 0px 0px 0px; margin-bottom: 10px;">Ruleset</div> | <div style="font-size: 25px; font-family: Verdana, Sans; font-weight: bold; padding: 0px 0px 0px 0px; margin-bottom: 10px;">Group</div> |
<xsl:for-each select="Ruleset/rule"> | <xsl:for-each select="Group/sentence"> |
<div id="cond" style="border: 1px solid #5b5b5b; padding: 5px 5px 5px 5px; font-size: 13px; margin-bottom: 10px; background-color: #ffbb00;"> | <div id="cond" style="border: 1px solid #5b5b5b; padding: 5px 5px 5px 5px; font-size: 13px; margin-bottom: 10px; background-color: #ffbb00;"> |
<div style="font-size: 18px; font-family: Verdana, Sans; font-weight: bold; padding: 0px; margin-bottom: 5px;">Rule <xsl:value-of select="position()"/></div> | <div style="font-size: 18px; font-family: Verdana, Sans; font-weight: bold; padding: 0px; margin-bottom: 5px;">Rule <xsl:value-of select="position()"/></div> |
<xsl:choose> | <xsl:choose> |
<xsl:when test="./formula/Implies/if/Or"> | <xsl:when test="./Implies/if/Or"> |
<div><b>One</b> of the conditions must be true | <div><b>One</b> of the conditions must be true |
<ul> | <ul> |
<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"> |
<li><xsl:value-of select="./Equal/arg/Var"/> == <xsl:value-of select="./Equal/arg/Const"/></li> | <li><xsl:value-of select="./Equal/side[1]/*"/> == <xsl:value-of select="./Equal/side[2]/*"/></li> |
</xsl:when> | </xsl:when> |
<xsl:when test="./Uniterm"> | <xsl:when test="./Atom"> |
<li><xsl:value-of select="./Uniterm/op/Const"/>( | <li><xsl:apply-templates select="./Atom"/> == true</li> |
<xsl:for-each select="./Uniterm/arg"> | </xsl:when> |
<xsl:choose> | <xsl:when test="./External"> |
<xsl:when test="./Var"> | <li>External <xsl:apply-templates select="./External/content/Expr|./External/content/Atom"/> == true</li> |
<i>var </i><xsl:value-of select="./Var"/> | |
</xsl:when> | |
<xsl:otherwise> | |
<xsl:value-of select="./Const"/> | |
</xsl:otherwise> | |
</xsl:choose> | |
<xsl:if test="position() != last()"> | |
, | |
</xsl:if> | |
</xsl:for-each> | |
) == true</li> | |
</xsl:when> | </xsl:when> |
</xsl:choose> | </xsl:choose> |
</ul></div> | </ul></div> |
</xsl:when> | </xsl:when> |
<xsl:when test="./formula/Implies/if/And"> | <xsl:when test="./Implies/if/And"> |
<div><b>All</b> conditions must be true | <div><b>All</b> conditions must be true |
<ul> | <ul> |
<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"> |
<li><xsl:value-of select="./Equal/arg/Var"/> == <xsl:value-of select="./Equal/arg/Const"/></li> | <li><xsl:value-of select="./Equal/side[1]/*"/> == <xsl:value-of select="./Equal/side[2]/*"/></li> |
</xsl:when> | </xsl:when> |
<xsl:when test="./Uniterm"> | <xsl:when test="./Atom"> |
<li><xsl:value-of select="./Uniterm/op/Const"/>( | <li><xsl:apply-templates select="./Atom"/> == true</li> |
<xsl:for-each select="./Uniterm/arg"> | </xsl:when> |
<xsl:choose> | <xsl:when test="./External"> |
<xsl:when test="./Var"> | <li>External <xsl:apply-templates select="./External/content/Expr|./External/content/Atom"/> == true</li> |
<i>var </i><xsl:value-of select="./Var"/> | |
</xsl:when> | |
<xsl:otherwise> | |
<xsl:value-of select="./Const"/> | |
</xsl:otherwise> | |
</xsl:choose> | |
<xsl:if test="position() != last()"> | |
, | |
</xsl:if> | |
</xsl:for-each> | |
) == true</li> | |
</xsl:when> | </xsl:when> |
</xsl:choose> | </xsl:choose> |
<div>Condition must be true<br/> | <div>Condition must be true<br/> |
<xsl:choose> | <xsl:choose> |
<xsl:when test="./formula/Implies/if/formula/Equal"> | <xsl:when test="./Implies/if/Equal"> |
<xsl:value-of select="./formula/Implies/if/formula/Equal/arg/Var"/> == <xsl:value-of select="./formula/Implies/if/formula/Equal/arg/Const"/> | <xsl:value-of select="./Implies/if/Equal/side[1]/*"/> == <xsl:value-of select="./Implies/if/Equal/side[2]/*"/> |
</xsl:when> | </xsl:when> |
<xsl:when test="./formula/Implies/if/formula/Uniterm"> | <xsl:when test="./Implies/if/Atom"> |
<xsl:value-of select="./formula/Implies/if/formula/Uniterm/op/Const"/>( | <xsl:apply-templates select="./Implies/if/Atom"/> == 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"/> == true |
<i>var</i> <xsl:value-of select="./Var"/> | |
</xsl:when> | |
<xsl:otherwise> | |
<xsl:value-of select="./Const"/> | |
</xsl:otherwise> | |
</xsl:choose> | |
<xsl:if test="position() != last()"> | |
, | |
</xsl:if> | |
</xsl:for-each> | |
) == true | |
</xsl:when> | </xsl:when> |
</xsl:choose> | </xsl:choose> |
</xsl:choose> | </xsl:choose> |
<div id="cond"> | <div id="cond"> |
<b>then</b> return <xsl:value-of select="./formula/Implies/then/formula/Uniterm/arg/*"/></div> | <xsl:choose> |
| <xsl:when test="./Implies/then/Atom"> |
| <b>then</b> assert <xsl:apply-templates select="./Implies/then/Atom"/> |
| </xsl:when> |
| <xsl:when test="./Implies/then/External"> |
| <b>then</b> assert External <xsl:apply-templates select="./Implies/then/External/content/Expr|./Implies/then/External/content/Atom"/> |
| </xsl:when> |
| </xsl:choose> |
| </div> |
</div> | </div> |
</xsl:for-each> | </xsl:for-each> |
</div> | </div> |
</ body> | </body> |
</ html> | </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]] |