Hi Bob, try to encapsulate the two calls in a <sequence> </sequence> pair. A function can hold one element only. Use a sequence that again can hold many elements.
Bodo > -----Original Message----- > From: Bob Salmi [mailto:bsa...@routingdynamics.com] > Sent: Tuesday, July 28, 2009 1:25 AM > To: staf-users@lists.sourceforge.net > Subject: [staf-users] STAXXMLParseException > > I'm sure I'm missing something silly as I'm new to staf/stax > > When I try and call a function twice I get the following parse > exception: > > RC:4001 > Result=Caught com.ibm.staf.service.stax.STAXXMLParseException: > > Line 34: The content of element type "function" must match > "((function- > prolog|function-description)?,function-epilog?,(function-no-args| > function-single-arg|function-list-args|function-map-args)?,(timer| > parallel|log|call|stafcmd|script|tcstatus|message|iterate|sequence| > import|raise|job|process|nop|try|break|testcase|paralleliterate| > continue|throw|release|signalhandler|rethrow|block|hold|terminate| > return|if|call-with-list|loop|call-with-map))". > > Request=STAF local STAX EXECUTE HOLD file :43:/Library/staf/services/ > stax/samples/bad.xml > > The xml is below. If I remove either of the function calls > from "main" > the code runs fine. > with both the calls to run_WriteTest I get the above parse exception. > > i.e. this works > > <defaultcall function="main"/> > <function name="main" > > <!-- call write test --> > > <call function="'run_WriteTest'"> </call> > <!-- <call function="'run_WriteTest'"> </call> --> > </function> > </stax> > > but the below does not > > Appologies for the formatting I stripped this out to a simple > example > that exhibits the behavior from a larger file. > > What am I missing ? > > bob-salmis-computer-3:samples bsalmi$ staf local stax version > Response > -------- > 3.3.7 > > > Thanks, > Bob > > > <?xml version="1.0" encoding="UTF-8" standalone="no"?> > <!DOCTYPE stax SYSTEM "stax.dtd"> > > <stax> > > <function name= "run_WriteTest" scope = "local"> > > <!-- function to call test App --> > <testcase name ="'testcase 1'"> > <sequence> > <process name="'bobs process'"> > <location>'10.211.55.4'</location> > <command mode="'shell'">'/bin/ls' </command> > <returnstdout/> > </process> > <message log="1"> 'STAXResult:\n %s' % (STAXResult[0][1])</message> > <if expr="RC != 0"> > <tcstatus result="'fail'"/> > <else> > <tcstatus result="'pass'"/> </else> > </if> > </sequence> > </testcase> > </function> > > <defaultcall function="main"/> > <function name="main" > > <!-- call write test --> > > <call function="'run_WriteTest'"> </call> > <call function="'run_WriteTest'"> </call> > </function> > </stax> > > > -------------------------------------------------------------- > ---------------- > Let Crystal Reports handle the reporting - Free Crystal > Reports 2008 30-Day > trial. Simplify your report design, integration and > deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > staf-users mailing list > staf-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/staf-users > ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ staf-users mailing list staf-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/staf-users