Assert Statement in Jet? [message #520512] |
Fri, 12 March 2010 11:42  |
Eclipse User |
|
|
|
I'm using an xml file as an input. I need to error check a version number that comes from the xml file against the version number of the template file before I allow the code generation to continue. In other non-Jet based projects, we use an ASSERT statement that prints a description of the error.
Does Jet support something like assert or is there something better I should use?
Thanks
|
|
|
Re: Assert Statement in Jet? [message #522332 is a reply to message #520512] |
Mon, 22 March 2010 03:20  |
Eclipse User |
|
|
|
Debbie:
This is no assert, but if you are looking to issue an error message, and
prevent further execution, I suggest using a combination of the c:log
tag and a c:if...
.... initialize variable, assuming no errors ...
<c:setVariable var="errorFound" select="false()"/>
.... do error checking ...
... when error is found ...
<c:setVariabler var="errorFound" select="true()"/>
... issue a message ...
<c:log severity="error">Your error message here...</c:log>
<c:if test="not(errorFound)">
... do the real work ....
</c:if>
The error message gets written to the execution console. Or, if you are
running the JET transformation via API, it is included in the IStatus
returned by the JET2Platform.runTransformOnXXX() methods. Either way,
you should be able to make the message visible to your users.
Paul
|
|
|
Powered by
FUDForum. Page generated in 0.30605 seconds