<?xml-stylesheet type="text/xsl" href="/xforms-tests/xsltforms/xsltforms.xsl"?>
<html xmlns:my="http://commerce.example.com/payment" xmlns:txs="http://sourceforge.net/projects/txs" xmlns="http://www.w3.org/1999/xhtml" xmlns:req="http://www.agencexml.com/requests" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xhtml="http://www.w3.org/1999/xhtml">
     <head>
          <title>11.4.b accessing context information for xforms-submit-done event</title>
          <xforms:model>
               <xforms:instance id="data">
                    <this xmlns="">
                         <that>
                              <the_other>
							  this that and the other...
						      </the_other>
                         </that>
                    </this>
               </xforms:instance>
               <xforms:instance id="event_catcher">
                    <eventinfo xmlns="">
                         <return_code/>
                         <response_headers/>
                    </eventinfo>
               </xforms:instance>
               <xforms:submission action="http://www.agencexml.com/xforms-tests/xsltforms/echo.php" id="sub_1" method="post" ref="instance('data')" replace="none">
                    <xforms:action ev:event="xforms-submit-done">
                         <xforms:setvalue ref="instance('event_catcher')/return_code" value="event('response-status-code')"/>
                         <!--  xforms 1.1 will return header[] from event('response-headers') -->
                         <xforms:insert context="instance('event_catcher')/response_headers" nodeset="*" origin="event('response-headers')"/>
                    </xforms:action>
               </xforms:submission>
          </xforms:model>
          <link href="../../driverPages/forms/TestSuite11.css" rel="stylesheet"/>
     </head>
     <body>
          <xforms:group>
               <xforms:label class="title">11.4.b accessing context information for xforms-submit-done event</xforms:label>
          </xforms:group>
          <xforms:group>
               <xforms:label>
                 When you activate the Submit Now submission control the instance data of the form will be 
                 submitted but the page will not be replaced by the form data. If the submission is successful, 
                 the protocol response code will be displayed in the Response Status Code output. If there are any 
                 header names or values returned they will be displayed in the Response Headers output. 
			</xforms:label>
          </xforms:group>
          <xforms:group>
               <xforms:label/>
               <xforms:submit submission="sub_1">
                    <xforms:label>Submit Now</xforms:label>
               </xforms:submit>
          </xforms:group>
          <xforms:group>
               <xforms:label/>
               <xforms:output ref="instance('event_catcher')/return_code">
                    <xforms:label>Response Status Code : </xforms:label>
               </xforms:output>
          </xforms:group>
          <xforms:group>
               <xforms:label>Response Headers : </xforms:label>
               <xforms:repeat nodeset="instance('event_catcher')/response_headers/header">
                    <xforms:group>
                         <xforms:label/>
                         <xforms:output ref="./name">
                              <xforms:label>Header Name : </xforms:label>
                         </xforms:output>
                    </xforms:group>
                    <xforms:group>
                         <xforms:label/>
                         <xforms:output ref="./value">
                              <xforms:label>Header Contents : </xforms:label>
                         </xforms:output>
                    </xforms:group>
               </xforms:repeat>
          </xforms:group>
		
     </body>
</html>
