<p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"
          xmlns:oxf="http://www.orbeon.com/oxf/processors"
          xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
          xmlns:sql="http://orbeon.org/oxf/xml/sql">
    <p:param name="instance" type="input"/>

    <p:processor name="oxf:xslt">
          <p:input name="data" href="#instance" />
          <p:input name="config">
          <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
            <xsl:template match="/">
              <sql:config>
                  
                      <sql:connection>
                     
                          <xsl:for-each select="/form/formations/diplomes/diplome[position()!=last()]">
                                             
                              <sql:execute>
                                 <sql:update>
                                     insert into diplomes(id_user,intitule,annee,mention) values(
                                     (select id_informations from informations where cin='q240214'),
                                     '<xsl:value-of select="intitule" />',
                                     '<xsl:value-of  select="annee" />',
                                     '<xsl:value-of  select="mention" />'
                                    )
                                     </sql:update>
                                    </sql:execute>
                              </xsl:for-each> 
                     
                  </sql:connection>
              </sql:config>
                </xsl:template>
                </xsl:stylesheet>
               </p:input>
              <p:output name="data" id="diplome-inserer"/>
             </p:processor>
    
             <!-- execution de la requete sql -->
                   <p:processor name="oxf:sql">
                       <p:input name="data"><rien/></p:input>
                       <p:input name="datasource" href="oxf:/FormationOrbeon/TestMigration/Datasource/datasource.xml" />
                       <p:input name="config" href="#diplome-inserer"/>
                    
              </p:processor>
    
    
      <p:processor name="oxf:file-serializer">
               <p:input name="config">
                   <config>
                        <content-type>text/html</content-type>
                       <directory>c:/</directory>
                       <file>diplomes.html</file>
                   </config>
               </p:input>
               <p:input name="data" href="#diplome-inserer" />
         </p:processor>
              
   
    
    </p:config>
    
