You can override any or all of the STAX signals and have them perform any 
actions you want.

Note that the default STAXEmptyList signal does show you exactly where the 
error occurred.  Here is a sample STAX job:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE stax SYSTEM "stax.dtd">

<stax>

  <defaultcall function="main"/>

  <function name="main">

    <sequence>

      <script>
        testList = []
      </script>

      <iterate in="testList" var="currentTest">
        <message log="1">'currentTest = %s ' % (currentTest)</message>
      </iterate>

    </sequence>

  </function>

</stax>

You get the following:

STAXEmptyList signal raised. Continuing job. 

===== XML Information =====

File: c:/staxtest/emptylist.xml, Machine: xxx.ibm.com
Line 16: Error in attribute "in" associated with element type "iterate".

===== Call Stack for STAX Thread 1 =====

[
  function: main (Line: 8, File: c:/staxtest/emptylist.xml, Machine: 
xxx.ibm.com)
  sequence: 2/2 (Line: 10, File: c:/staxtest/emptylist.xml, Machine: 
xxx.ibm.com)
]

David Bender
STAF/STAX Development
8-1268 (512-838-1268) 
IBM Austin Bldg. 903-5B002
Internet: [EMAIL PROTECTED]




"Ahmed Mostafa" <[EMAIL PROTECTED]> 
Sent by: [EMAIL PROTECTED]
05/16/2008 09:35 AM

To
STAF <[email protected]>
cc
David Bender/Austin/[EMAIL PROTECTED]
Subject
Re: [staf-users] [STAX] Disable STAX signals






OK, my second question: can I disable STAX signals and cause them to throw 
errors? I need to know the exact location that caused the error instead of 
asynchronous error handling.

2008/5/16 David Bender <[EMAIL PROTECTED]>:

The STAXEmptyList signal is just informational...it does not terminate the 
job.  You can override the STAXEmptyList signal to perform any set of 
tasks, or add a check to determine if the list is empty. 

The following thread in the Help forum describes overriding the default 
signal handler for STAXEmptyList. 
https://sourceforge.net/forum/message.php?msg_id=3824933 
It includes an example of adding an <if> element that checks if a list is 
empty and does whatever you want, instead of adding a signalhandler for a 
STAXEmptyList signal. 

David Bender
STAF/STAX Development
8-1268 (512-838-1268) 
IBM Austin Bldg. 903-5B002
Internet: [EMAIL PROTECTED]



"Ahmed Mostafa" <[EMAIL PROTECTED]> 
Sent by: [EMAIL PROTECTED] 
05/16/2008 01:04 AM 


To
STAF <[email protected]> 
cc

Subject
[staf-users] [STAX] Disable STAX signals








Hello, 
1.        Why does STAX raise a STAXEmptyList signal for the empty list 
([]) while Python 2.1 allows iteration on empty lists (just ignore them)? 
2.        Can I disable STAX signals and cause them all to stop execution 
or throw errors? I need to know the exact location that caused the error 
instead of asynchronous error handling. 
Thanks
-- 
Ahmed Mostafa
0123919750
[EMAIL PROTECTED]

Software Developer
IBM Egypt, Cairo Technology Development Center 
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/_______________________________________________

staf-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/staf-users




-- 
Ahmed Mostafa
0123919750
[EMAIL PROTECTED]
Software Developer
IBM Egypt, Cairo Technology Development Center 
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
staf-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/staf-users

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
staf-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to