[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Exit use case: please review
|
As I am putting together a
set of XTemp examples and use cases, I just want to make sure we have a consensus
about the Exit semantics in various cases. Please review the attached
script and its expected output, which should be : >We get here because the
exit (1) in subvar only breaks out of the var definition. >We get here because the
exiting from scriplet sub does not escalate beyond it. >Mainvar: Exit 2 Which I believe reflects the agreement
we came up with, about Exit not breaking out of Var definitions. But the current prototype
returns: >We get here because the
exiting from scriplet sub does not escalate beyond it. >Mainvar: Exit 1 As Exit breaks out of var
definitions. If we agree on the former
interpretation, we’ll need to update the prototype (Chuck: will you
have time to do this update? Else I can work on it then double check with you
to make sure I did not break something else) Thanks, Jacques |
<script-package xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" schema-version-id="0.4"
xsi:schemaLocation="http://docs.oasis-open.org/tamie/xtemp/draft/20090909 http://www.oasis-open.org/committees/download.php/34985/xtemp-0-6-3.xsd"
xmlns="http://docs.oasis-open.org/tamie/xtemp/draft/20090909">
<!-- Expected Result (standard output):
We get here because the exit (1) in subvar only breaks out of the var definition.
We get here because the exiting from scriplet sub does not escalate beyond it.
Mainvar: Exit 2
-->
<scriplet name="main">
<var name="mainvar">
<start scriplet="sub"/>
<message>We get here because the exiting from scriplet sub does not escalate beyond it.</message>
</var>
<message>Mainvar: <eval expr="xsd:string($mainvar)"/></message>
</scriplet>
<scriplet name="sub">
<var name="subvar">
<if expr="true()">
<exit>Exit 1</exit>
</if>
<report>We never get there</report>
</var>
<message>We get here because the exit (1) in subvar only breaks out of the var definition.</message>
<if expr="true()">
<exit>Exit 2</exit>
</if>
<message>We never get here since the exit (2) in scriplet body breaks out of this scriplet.</message>
<message>Subvar: <eval expr="xsd:string($subvar)"/>.</message>
</scriplet>
</script-package>
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]