<?xml version="1.0" encoding="UTF-8"?>
<!--
	Feuille de transformation appliquée au Fichier CDM de l'application Uniform vers FO pour sérialisation PDF
	Author: Loic Pénet
	Version Version 1,1
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
xmlns:ns2="http://cdm-fr.fr/2011/CDM-frSchema" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">
	<xsl:output method="xml" encoding="ISO-8859-1" doctype-public="oeuvre.dtd" indent="yes"/>
	
	<xsl:include href="../amu/composants/program.v01.xsl" />
	        <!-- Fichier des libelles et constantes -->
        <xsl:variable name="variablesExt"   select="document('../commun/variablesExt.xml')" />
	<xsl:include href="../amu/composants/commun/commun_fr-FR.xsl" />
	<!-- Cette variable locale permet de déterminer si l'on est sur une licence pour frais d'inscription -->
<xsl:variable name="vBoolEstUneLicence">
	<xsl:call-template name="tEstUneLicence"/>
</xsl:variable>

<xsl:variable name="vBoolEstUnMaster">
<!-- Cette variable locale permet de déterminer si l'on est sur un master pour frais d'inscription -->
	<xsl:call-template name="tEstUnMaster"/>
</xsl:variable>

<!-- variable contenant se type de ip : master ou licence-->
    <xsl:variable name="Lic_master">
       <xsl:value-of select="key('cdmObj',$oidFormation)/qualification/ns2:degree/@degree"/>
    </xsl:variable>


	<xsl:key name="cdmObj" match="orgUnit|program|course|subProgram|person" use="@id"/>
	<xsl:key name="objet" match="orgUnit | program | subProgram | course | person" use="@id"/>
	<!-- paramétres de la requête -->
	<xsl:param name="_lang"/>
	<xsl:param name="_oid"/>
	<xsl:param name="ID"/>
	<xsl:param name="appContext"/>
	<!-- pour afficher la suite des subProgram ou autre (1)  ou rien après le program (0) -->
	<xsl:param name="_suiteProgramStructure" select="1"/>
	<!-- version PDF avec traitement des subProgram (1) -->
	<xsl:param name="_suiteSubProgram" select="1"/>
	<!-- traitement course non() version courte(1)  version longue(2)-->
	<xsl:param name="_traiteCourse" select="1"/>
	<!-- pour afficher le detail des personnes (1) ou (0) -->
	<xsl:param name="_detailPerson" select="1"/>
	<!-- Afficher les param d'entrée-->
	<xsl:param name="_afficheParam">0</xsl:param> 
	<!-- flux xml manipulés -->
	<xsl:variable name="CDM" select="/"/>
	<xsl:variable name="variables" select="document('../commun/variables_PDF.amu.xml')"/>
	<xsl:variable name="baseMediaPdf" select="concat($appContext,$variables/variables/appli/variable[@id='def_media']/@value)"/>
	<!--  <xsl:variable name="modules" select="document('templates/modules.xml')"/>-->
	<xsl:variable name="debug" select="$variables/variables/appli/variable[@id='debugPdf']/@value"/>
	<xsl:variable name="debugNiveau" select="$variables/variables/appli/variable[@id='debugPdfNiveau']/@value"/>
	<!-- Choix d'une ref de program ou ue ou ... ou par défaut le premier program du fichier -->
	<xsl:variable name="_langPdf">
		<xsl:choose>
			<xsl:when test="$_lang =''"><xsl:value-of select="/CDM/@language"/></xsl:when>
			<xsl:when test="not(normalize-space(/CDM/@language) = $_lang)"><xsl:value-of select="/CDM/@language"/></xsl:when>
			<xsl:otherwise><xsl:value-of select="'fr-FR'"/></xsl:otherwise>
		</xsl:choose>
	</xsl:variable>
	<!--  -->
	<xsl:variable name="oidFormation">
		<xsl:choose>
			<xsl:when test="not($ID = '' )">
				<xsl:value-of select="$ID"/>
			</xsl:when>
			<xsl:when test="not($_oid = '' )">
				<xsl:value-of select="$_oid"/>
			</xsl:when>
			<xsl:otherwise>
				/
				<xsl:choose>
					<xsl:when test="not(normalize-space(/CDM/program[1]/@id)='')">
						<xsl:value-of select="normalize-space(/CDM/program[1]/@id)"/>
					</xsl:when>
					<xsl:otherwise>
						<xsl:value-of select="normalize-space(/CDM/program[1]/@ident)"/>
					</xsl:otherwise>
				</xsl:choose>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:variable>
	<!-- langue par défaut du CDM -->
	<xsl:variable name="langueFluxCDM" select="/CDM/@language"/>
	<!--  -->
	<xsl:variable name="typeFormation" select="/CDM/program[(@id = $oidFormation) or (@ident = $oidFormation)]/qualification/ns2:degree"/>
	<!--  -->
	<xsl:variable name="couleur">
		<xsl:value-of select="$variables/variables/contentpdfvar/formations/formation[degree = $typeFormation]/couleur"/>
	</xsl:variable>
	<!--  -->
	<xsl:variable name="duree">
		<xsl:value-of select="number(/CDM/program[(@id = $oidFormation) or (@ident = $oidFormation)]/qualification/ns2:credits/@ECTScredits) div 30"/>
	</xsl:variable>
	<!--  -->
	<xsl:variable name="creditRequis">
		<xsl:value-of select="$variables/variables/contentpdfvar/formations/formation[degree =$typeFormation]/crediRequis"/>
	</xsl:variable>
	<!--  -->
	<xsl:variable name="valCreditECTS">
		<xsl:value-of select="number(/CDM/program[(@id = $oidFormation) or (@ident = $oidFormation)]/qualification/ns2:credits/@ECTScredits)"/>
	</xsl:variable>
	<xsl:include href="custom.pdf.sample.xsl"/>
	<xsl:template match="/">

		<!-- definir le  layout master -->
		<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
			<!-- definir le  layout master -->
			<fo:layout-master-set>
				<fo:simple-page-master master-name="Couverture" page-height="29.7cm" page-width="21cm">
					<!-- padding="7pt" -->
					<fo:region-body region-name="xsl-region-body" margin="0cm" margin-top="6cm"/>
					<fo:region-before region-name="xsl-entete-couv" extent="1cm" display-align="before"/>
					<fo:region-after region-name="bas_page-couv" extent="1cm" display-align="after"/>

				</fo:simple-page-master>
				<!--  -->
				<fo:simple-page-master master-name="all-pages" page-height="29.7cm" page-width="21cm">
					<fo:region-body region-name="xsl-region-body-suite" margin="1.3cm" column-count="2" column-gap="0.5cm" margin-top="3cm" 
							/>
					<fo:region-before region-name="xsl-entete-suite" extent="1.5cm" display-align="before"/>
					<fo:region-after region-name="bas_page-suite" extent="1cm" display-align="after"/>
				</fo:simple-page-master>
				<!--  -->
				<fo:page-sequence-master master-name="Couv">
					<fo:repeatable-page-master-reference master-reference="Couverture"/>
				</fo:page-sequence-master>
				<fo:page-sequence-master master-name="default-sequence">
					<fo:repeatable-page-master-reference master-reference="all-pages"/>
				</fo:page-sequence-master>
			</fo:layout-master-set>


			<fo:page-sequence master-reference="Couv">
				<fo:static-content flow-name="xsl-entete-couv">
					<fo:block space-before.optimum="7pt" font-family="Helvetica">
						<xsl:apply-templates select="$CDM/CDM/orgUnit/orgUnitName/text">
							<xsl:with-param name="taille-Texte" select="$variables/variables/contentpdfvar/formatage/font/niveau[@ref = 'entete']/@size"/>
							<xsl:with-param name="text-align" select="$variables/variables/contentpdfvar/formatage/font/niveau[@ref = 'entete']/@align"/>
						</xsl:apply-templates>

                                        <fo:block text-align="left" >
                                                <fo:external-graphic src="{$baseMediaPdf}/images/{$variables/variables/contentpdfvar/formatage/logo/@nom}"
                                                                     content-height="70px" content-width="800px"/>
                                        </fo:block>

                                        <!-- Titre principal de la formation-->
                                        <fo:block text-align="center" font-weight="bold" space-before="{$variables/variables/contentpdfvar/formatage/margeSousTitre/@select}pt" color="{$couleur}" border-width="1pt" border-style="solid" border-color="#e22202" background-color="#f9f9f9" padding="7mm">
                                                <!-- Rajout du titre du programe initial si pas id de program-->
                                                <xsl:if test="not(local-name(key('cdmObj', $oidFormation))='program')">
                                                        <fo:block>
                                                                <xsl:apply-templates select="/CDM/program[1]/ns2:programName/ns2:text">
                                                                        <xsl:with-param name="taille-Texte" select="$variables/variables/contentpdfvar/formatage/font/niveau[@ref = 1]/@size"/>
                                                                        <xsl:with-param name="text-align" select="'center'"/>
                                                                </xsl:apply-templates>
                                                                <fo:leader leader-pattern="dots"
                                                                        rule-thickness="0.1pt"
                                                                        leader-length="6cm"
                                                                        space-before.optimum="0pt"
                                                                        space-after.optimum="12pt"
                                                                        start-indent="1cm"
                                                                        end-indent="1cm"
                                                                        color="black"/>
                                                        </fo:block>
                                                </xsl:if>
                                                <xsl:choose>
                                                        <xsl:when test="(local-name(key('cdmObj', $oidFormation))='program') or (local-name(key('cdmObj', $oidFormation))='subProgram')">
                                                                <xsl:apply-templates select="key('cdmObj', $oidFormation)/ns2:programName/ns2:text[@language=$_langPdf or not(@language)]">
                                                                        <xsl:with-param name="taille-Texte" select="$variables/variables/contentpdfvar/formatage/font/niveau[@ref = 2]/@size"/>
                                                                        <xsl:with-param name="text-align" select="'center'"/>
                                                                </xsl:apply-templates>
                                                        </xsl:when>
                                                        <xsl:when test="local-name(key('cdmObj', $oidFormation))='course'">
                                                                <xsl:apply-templates select="key('cdmObj', $oidFormation)/courseName/text[@language=$_langPdf or not(@language)]">
                                                                        <xsl:with-param name="taille-Texte" select="$variables/variables/contentpdfvar/formatage/font/niveau[@ref = 2]/@size"/>
                                                                        <xsl:with-param name="text-align" select="'center'"/>
                                                                </xsl:apply-templates>
                                                        </xsl:when>

                                                        <!-- <xsl:when test=""></xsl:when> -->
                                                </xsl:choose>

                                                <!-- Titre spécialités (sont affichés selon la variable externe) -->
                                                <xsl:if test="$variables/variables/contentpdfvar/affichage/optionAffichage[@rubrique='titreSpecialite']/@select = 1">
                                                        <xsl:for-each select="/CDM/program[not( (@id = $oidFormation) or (@ident = $oidFormation) )]/ns2:programName">
                                                                <fo:block font-size="{$variables/variables/contentpdfvar/formatage/font/niveau[@ref = 'paragraphe']/@size}" font-weight="normal" text-align="center">
                                                                        <xsl:apply-templates select="./text[@language=$_langPdf or not(@language)]">
                                                                                <xsl:with-param name="break" select="'0'"/>
                                                                        </xsl:apply-templates>
                                                                </fo:block>
                                                        </xsl:for-each>
                                                </xsl:if>
                                        </fo:block>

                                        <!--prefaceEtab si renseigné et si souhaitée selon la variable externe -->
                                        <xsl:variable name="desc" select="normalize-space(/CDM/orgUnit/orgUnitDescription)"/>
                                        <xsl:if test="($variables/variables/contentpdfvar/affichage/optionAffichage[@rubrique='prefaceEtab']/@select = 1) and (not($desc =''))">
                                                <fo:block font-weight="normal" space-before="10mm" font-size="{$variables/variables/contentpdfvar/formatage/font/niveau[@ref = 'paragraphe']/@size}" color="{$couleur}" border-width="1pt" border-style="solid"
                                                        border-color="#e22202" background-color="#f9f9f9" padding="7mm">
                                                        <xsl:apply-templates select="/CDM/orgUnit/orgUnitDescription"/>
                                                </fo:block>
                                        </xsl:if>






					</fo:block>
				</fo:static-content>
				<fo:static-content flow-name="bas_page-couv">
					<fo:block text-align="center">
						<fo:table>
							<fo:table-column column-width="16cm"/>
							<fo:table-column column-width="3cm"/>
							<fo:table-body>
								<fo:table-row>
									<fo:table-cell padding="2pt" border="0">
										<fo:block font-family="Helvetica" font-size="{$variables/variables/contentpdfvar/formatage/font/niveau[@ref = 'pied']/@size}" text-align="center" padding-start="10pt"><!-- Affichage de le dernière modification si la valeur existe -->
											<!--  <xsl:if test="not(normalize-space(/CDM/program[1]/infoBlock/subBlock[@userDefined='derniereModification']) = '')">
												<xsl:text> </xsl:text>Dernière modification<xsl:text> : </xsl:text>
												<xsl:call-template name="traitdate">
													<xsl:with-param name="date">
														<xsl:value-of select="normalize-space(/CDM/program[1]/infoBlock/subBlock[@userDefined='derniereModification'])"/>
													</xsl:with-param>
												</xsl:call-template>
												<xsl:text> </xsl:text>
											</xsl:if>-->
											<xsl:variable name="www">
												<xsl:value-of select="/CDM/orgUnit/webLink[@role='homepage']/href"/>
											</xsl:variable>
											<fo:basic-link external-destination="url({$www})" text-decoration="underline" color="{$variables/variables/contentpdfvar/formatage/couleurLiens/@color}">
												<xsl:value-of select="/CDM/orgUnit/orgUnitName/text[@language=$_langPdf or not(@language)]"/>
											</fo:basic-link>
										</fo:block>
									</fo:table-cell>
									<fo:table-cell padding="0pt" border="0">
										<fo:block font-family="Helvetica" font-size="11pt" text-align="end">Page <fo:page-number/>
										</fo:block>
									</fo:table-cell>
								</fo:table-row>
							</fo:table-body>
						</fo:table>
					</fo:block>
				</fo:static-content>



				<fo:flow flow-name="xsl-region-body">
					<!--  uniquement si debug -->
					<xsl:if test="$_afficheParam = '1'">
						<fo:block font-size="10pt">_langPdf (<xsl:value-of select="$_langPdf"/>)</fo:block>
						<fo:block font-size="10pt">_oid (<xsl:value-of select="$_oid"/>)</fo:block>
						<fo:block font-size="10pt">appContext (<xsl:value-of select="$appContext"/>)</fo:block>
						<fo:block font-size="10pt">_suiteSubProgram (<xsl:value-of select="$_suiteSubProgram"/>)</fo:block>
						<fo:block font-size="10pt">_traiteCourse (<xsl:value-of select="$_traiteCourse"/>)</fo:block>
						<fo:block font-size="10pt">_detailPerson (<xsl:value-of select="$_detailPerson"/>)</fo:block>
						<fo:block font-size="10pt">_suiteProgramStructure (<xsl:value-of select="$_suiteProgramStructure"/>)</fo:block>
						<fo:block font-size="10pt">typeFormation (<xsl:value-of select="$typeFormation"/>)</fo:block>
					</xsl:if>
					<xsl:if test="$debug = '1'">
						<fo:block font-size="10pt" font-weight="bold" color="#f00">debug</fo:block>
						<xsl:choose>
							<xsl:when test="not($variables/variables/contentpdfvar/formations/formation[degree = $typeFormation])">
								<fo:block font-size="10pt">Attention fichier variable non renseigné sur formation de type (<xsl:value-of select="$typeFormation"/>)</fo:block>
							</xsl:when>
						</xsl:choose>
						<fo:block font-size="12pt">
							Demande de PDF pour <xsl:value-of select="local-name(key('cdmObj', $oidFormation))"/> ref <xsl:value-of select="$oidFormation"/>
						</fo:block>
						<fo:block font-size="10pt">typeFormation (<xsl:value-of select="$typeFormation"/>)</fo:block>
						<fo:block font-size="10pt">couleur (<xsl:value-of select="$couleur"/>)</fo:block>
						<fo:block font-size="10pt">durée (<xsl:value-of select="$duree"/>)</fo:block>
						<fo:block font-size="10pt">creditRequis (<xsl:value-of select="$creditRequis"/>)</fo:block>
						<fo:block font-size="10pt">valCreditECTS (<xsl:value-of select="$valCreditECTS"/>)</fo:block>
					</xsl:if>


					<fo:block  font-size="8px" text-align="left" margin-left="20pt" >
					<!--<fo:table table-layout="fixed" border-width="20pt"  space-start="20pt" padding-start="20pt" border-start="20pt" >-->
                                        <fo:table table-layout="fixed" >
					  <fo:table-column column-width="6.5cm"/>
					  <fo:table-column column-width="6.5cm"/>
					  <fo:table-column column-width="6.5cm"/>
					  <fo:table-body>
					    <fo:table-row>
					     <fo:table-cell border-style="solid" border-color="white" border-width="0pt"  background-color="#9E9E9E"  margin-left="0pt">
					     	<fo:block text-align="center" font-size="12px"  margin-left="0pt">
							<!-- Selon le nb de responsable, le titre change-->
                					<xsl:if test="count(key('cdmObj',$oidFormation)/contacts/refPerson)=0">Pas de responsable</xsl:if>
				                	<xsl:if test="count(key('cdmObj',$oidFormation)/contacts/refPerson)=1">Le responsable</xsl:if>
				                	<xsl:if test="count(key('cdmObj',$oidFormation)/contacts/refPerson)>1">Les responsables</xsl:if>
					      	</fo:block>
					      	<fo:block  margin-left="0pt">
							<xsl:apply-templates select="key('cdmObj',$oidFormation)/contacts/refPerson"/>
                                              	</fo:block>
                                              </fo:table-cell>
           				      <fo:table-cell border-style="solid" border-color="white" border-width="0pt"  background-color="#9E9E9E" >   
						<fo:block  text-align="center" font-size="12px">
							Description
						</fo:block>
						<fo:block>
							<!-- affichage du type de diplome -->
							<fo:inline font-weight="bold">
							<xsl:value-of select="$variablesExt/variables/libelleVar/libellePart[@type='libTypeDiplome']/value[@lang=$_langPdf]"/>
							</fo:inline>
							<xsl:value-of select="$Lic_master"/>
						</fo:block>
						<fo:block>
							<!-- affichage des frais d'inscription -->
							<fo:inline font-weight="bold">
							<xsl:value-of select="$variablesExt/variables/libelleVar/libellePart[@type='libFraisInscription']/value[@lang=$_langPdf]"/>
							</fo:inline>
							<xsl:choose>
								<xsl:when test="$Lic_master = 'licence'">
									<xsl:value-of select="$variablesExt/variables/dataVar/FraisInscriptionLicence/value"/>
								</xsl:when>
								<xsl:when test="$Lic_master = 'master'">
									<xsl:value-of select="$variablesExt/variables/dataVar/FraisInscriptionMaster/value"/>
								</xsl:when>
								<xsl:otherwise>....</xsl:otherwise>
							</xsl:choose>
						</fo:block>
						<fo:block> 
							<fo:inline font-weight="bold">
								duree 
							</fo:inline>
							<xsl:value-of select="$duree"/>
						</fo:block>
						<fo:block>
							<fo:inline font-weight="bold">CreditRequis </fo:inline>
							<xsl:value-of select="$creditRequis"/>
						<!-- affichage du nbre de credits -->	
						<xsl:if test="key('cdmObj',$oidFormation)/qualification/ns2:credits/@ECTScredits!=''">
							 <xsl:value-of select="$variablesExt/variables/libelleVar/libellePart[@type='libNbCreditsPrepares']/value[@lang=$_langPdf]"/>
							 <xsl:value-of select="$valCreditECTS"/>
						</xsl:if>
						</fo:block>
					

                                              
                                             </fo:table-cell>
                                                <fo:table-cell border-style="solid" border-color="white" border-width="0pt"  background-color="#9E9E9E">
                                                <fo:block text-align="center" font-size="12px">
							Informations
						</fo:block>
						<fo:block>
						<!-- affichage du domaine principal-->
						<fo:inline font-weight="bold">
							<xsl:value-of select="$variablesExt/variables/libelleVar/libellePart[@type='libDomainePrincipal']/value[@lang=$_langPdf]"/>
						</fo:inline>
						<xsl:value-of select="key('cdmObj',$oidFormation)/ns2:habilitation/ns2:field/@primaryDomainName"/>
						</fo:block>
						<fo:block>
						<!-- affichage du libelle de la mention-->
							<fo:inline font-weight="bold">
							<xsl:value-of select="$variablesExt/variables/libelleVar/libellePart[@type='libMention']/value[@lang=$_langPdf]"/>
							</fo:inline>
				                <xsl:variable name="vProgramNameText" select="key('cdmObj', $oidFormation)/ns2:programName/ns2:text[@language=$_langPdf or not(@language)] | key('cdmObj',$oidFormation)/courseName/text"/>
				                <xsl:value-of select="substring-after($vProgramNameText,'MENTION : ')"/>
						</fo:block>
						<fo:block>
						<!-- affichagez de la finalite mention -->
						<fo:inline font-weight="bold">
							<xsl:value-of select="$variablesExt/variables/libelleVar/libellePart[@type='libFinaliteMention']/value[@lang=$_langPdf]"/>
						</fo:inline>
						<xsl:value-of select="key('cdmObj',$oidFormation)/ns2:habilitation/ns2:field/@fieldPurpose"/>
						</fo:block>
						
						<fo:block>
							<fo:inline font-weight="bold">
					        	<xsl:if test="$vBoolEstUnProgramme='true'">
								<xsl:call-template name="tCommunGestionLibelle"><xsl:with-param name="pIdent" select="'libNomProgramme'"/></xsl:call-template>
								<!--<xsl:call-template name="tProgramProgramName"/>-->
					        	</xsl:if>

						        <xsl:if test="$vBoolEstUneSpecialite='true'">
						                <xsl:call-template name="tCommunGestionLibelle"><xsl:with-param name="pIdent" select="'libSpecialite'"/></xsl:call-template>
					                        <!--<xsl:call-template name="tProgramProgramName"/>-->
                		
						        </xsl:if>
							</fo:inline>
						</fo:block>
					      </fo:table-cell>
					    </fo:table-row>     
  					</fo:table-body>
					</fo:table>


					</fo:block>

                                </fo:flow>
                        </fo:page-sequence>
                        <!-- **********************************fin de la premier page ************************************************** -->
                        <fo:page-sequence master-reference="default-sequence" initial-page-number="2">
                                <!-- Entete des pages suivantes-->
                                <fo:static-content flow-name="xsl-entete-suite">

                                        <!--  petit logo -->
                                        <fo:block text-align="left" >
                                                <fo:external-graphic src="{$baseMediaPdf}/images/{$variables/variables/contentpdfvar/formatage/logo/@nom}"
                                                                     content-height="56px" content-width="640px"/>
                                        </fo:block>

					<fo:block space-before.optimum="7pt" font-family="Helvetica">
						<xsl:apply-templates select="$CDM/CDM/orgUnit/orgUnitName/text">
							<xsl:with-param name="taille-Texte" select="$variables/variables/contentpdfvar/formatage/font/niveau[@ref = 'entete']/@size"/>
							<xsl:with-param name="text-align" select="'center'"/>
						</xsl:apply-templates>
					</fo:block>
				</fo:static-content>
				<!-- bas de page des pages suivantes-->
				<fo:static-content flow-name="bas_page-suite">
					<fo:block text-align="center">
						<fo:table>
							<fo:table-column column-width="16cm"/>
							<fo:table-column column-width="3cm"/>
							<fo:table-body>
								<fo:table-row>
									<fo:table-cell padding="2pt" border="0">
										<fo:block font-family="Helvetica" font-size="{$variables/variables/contentpdfvar/formatage/font/niveau[@ref = 'pied']/@size}" text-align="center" padding-start="10pt"><!--  Formation ref. <xsl:value-of select="$oidFormation"/> - --> <!-- Affichage de le dernière modification si la valeur existe -->
											<!-- Catalogue des formations de  -->
											<xsl:value-of select="$variables/variables/contentpdfvar/contents/content[@type='titreBaPage']/value[@lang=$_langPdf]"/>
											<!-- mot de liaison  -->
											<xsl:text> </xsl:text>
											<xsl:value-of select="$variables/variables/contentpdfvar/contents/content[@type='lApos']/value[@lang=$_langPdf]"/>
											<xsl:text> </xsl:text>
											<xsl:value-of select="/CDM/orgUnit/orgUnitName/text"/>
										</fo:block>
									</fo:table-cell>
									<fo:table-cell padding="0pt" border="0">
										<fo:block font-family="Helvetica" font-size="11pt" text-align="end">Page <fo:page-number/>
										</fo:block>
									</fo:table-cell>
								</fo:table-row>
							</fo:table-body>
						</fo:table>
					</fo:block>
				</fo:static-content>
				<!-- Corps des pages suivantes -->
				<fo:flow flow-name="xsl-region-body-suite">
					<fo:block font-size="{$variables/variables/contentpdfvar/formatage/font/niveau[@ref = 'paragraphe']/@size}" 
						  text-align="{$variables/variables/contentpdfvar/formatage/font/niveau[@ref = 'paragraphe']/@align}"
						  text-indent="{$variables/variables/contentpdfvar/formatage/font/niveau[@ref = 'paragraphe']/@indent}" 
						  font-weight="{$variables/variables/contentpdfvar/formatage/font/niveau[@ref = 'paragraphe']/@weight}"
						  font-family="{$variables/variables/contentpdfvar/formatage/font/niveau[@ref = 'paragraphe']/@family}" 
						  font-style="{$variables/variables/contentpdfvar/formatage/font/niveau[@ref = 'paragraphe']/@style}"
						  color="{$variables/variables/contentpdfvar/formatage/font/niveau[@ref = 'paragraphe']/@color}">



					<fo:block>
						le 1er
						<xsl:call-template name="QualificationProfessionRomeDataPdf"></xsl:call-template>
					</fo:block>
					
					<fo:block>
						le 2eme
						<xsl:apply-templates select="key('cdmObj',$oidFormation)/qualification/ns2:profession/ns2:romeData/ns2:text[@language=$_langPdf or not(@language)]"/>
					</fo:block>

					<!-- Description/Objectifs -->
                                        <fo:block>
                                                <fo:inline font-weight="bold">
                                                        <xsl:value-of select="$variablesExt/variables/libelleVar/libellePart[@type='libContexteEtEnjeux']/value[@lang=$_langPdf]"/>
                                                </fo:inline>
					</fo:block>
					<fo:block>
						<xsl:apply-templates select="key('cdmObj',$oidFormation)/ns2:habilitation/ns2:contexteEtEnjeux/ns2:contexteEtEnjeuxInfo/p"/>
                                        </fo:block>

					<!-- Description/Connaissances scientifiques à acquérir -->
                                        <fo:block>
                                                <fo:inline font-weight="bold">
                                                        <xsl:value-of select="$variablesExt/variables/libelleVar/libellePart[@type='libConnaissancesEnseignees']/value[@lang=$_langPdf]"/>
                                                </fo:inline>
                                        </fo:block>

					<fo:block>
					
						<xsl:for-each select ="key('cdmObj',$oidFormation)/learningObjectives[@blockLang=$_lang or not(@blockLang)]/p">
					<!--margin-left="5cm"  -->
							<fo:block margin-left="0cm" font-size="10px">
							<xsl:apply-templates select="."/>
							</fo:block>
						</xsl:for-each>
					
					</fo:block>
					

			           <!--     <fo:list-block>
                        <xsl:for-each select="key('cdmObj',$oidFormation)/learningObjectives[@blockLang=$_lang or not(@blockLang)]/p">
                                <fo:list-item>
                                        <fo:list-item-label><fo:block>&#x2022;</fo:block></fo:list-item-label>
                                        <fo:list-item-body start-indent="4pt">
                                                <fo:block margin-left="5cm">
                                                        <xsl:value-of select="."/>
                                                </fo:block>
                                        </fo:list-item-body>
                                </fo:list-item>
                        </xsl:for-each>
                </fo:list-block>-->



					<!-- Description/Compétences à acquérir -->
                                        <fo:block>
                                                <fo:inline font-weight="bold">
                                                        <xsl:value-of select="$variablesExt/variables/libelleVar/libellePart[@type='libCompetenceSavoirEnseignes']/value[@lang=$_langPdf]"/>
                                                </fo:inline>
                                        </fo:block>
                                        <fo:block>
                                                <xsl:apply-templates select="key('cdmObj',$oidFormation)/qualification/ns2:studyQualification/infoBlock[@blockLang=$_lang or not(@blockLang)]/p"/>
                                        </fo:block>












   <!--                                     <fo:block>
                                                <xsl:apply-templates select="key('cdmObj',$oidFormation)/targetGroup[@blockLang=$_langPdf or not(@blockLang)]"/>
                                        </fo:block>
                                        <fo:block>
                                                <xsl:apply-templates select="key('objet',$oidFormation)/ns2:habilitation/ns2:contexteEtEnjeux"/></fo:block>
                                        <fo:block>
                                                <xsl:apply-templates select="key('objet',$oidFormation)/learningObjectives[@blockLang=$_langPdf or not(@blockLang)]/node()"/>
                                        </fo:block>
                                        <fo:block>
                                                <xsl:apply-templates select="key('objet',$oidFormation)/qualification/ns2:studyQualification/infoBlock[@blockLang=$_langPdf or not(@blockLang)]"/>
                                        </fo:block>



<fo:block>
<xsl:apply-templates select="key('objet',$oidFormation)/ns2:habilitation/ns2:contexteEtEnjeux"/></fo:block>
<fo:block>
<xsl:apply-templates select="key('objet',$oidFormation)/learningObjectives[@blockLang=$_langPdf or not(@blockLang)]/node()"/>
</fo:block>
<fo:block>
<xsl:apply-templates select="key('objet',$oidFormation)/qualification/ns2:studyQualification/infoBlock[@blockLang=$_langPdf or not(@blockLang)]"/>
</fo:block>

-->




					</fo:block>
				</fo:flow>
			</fo:page-sequence>
		</fo:root>
	</xsl:template>


	<xsl:template name="QualificationProfessionRomeDataPdf">
                <fo:list-block>
                        <xsl:for-each select="key('cdmObj',$oidFormation)/qualification/ns2:profession/ns2:romeData/ns2:text[@language=$_langPdf or not(@language)]">
                                <fo:list-item>
                                        <fo:list-item-label><fo:block>&#x2022;</fo:block></fo:list-item-label>
                                        <fo:list-item-body start-indent="4pt">
                                                <fo:block>
                                                        <xsl:value-of select="."/>
                                                </fo:block>
                                        </fo:list-item-body>
                                </fo:list-item>
                        </xsl:for-each>
                </fo:list-block>
        </xsl:template>




	<xsl:template match="href">
		<xsl:value-of select="normalize-space(.)"/>
	</xsl:template>
	<!-- template de présentation -->
	<xsl:template match="list">
		<fo:list-block margin-left="10mm" provisional-label-separation="15mm" provisional-distance-between-starts="15mm">
			<xsl:apply-templates select="listItem"/>
		</fo:list-block>
	</xsl:template>
	<!--  -->
	<xsl:template match="listItem">
		<!-- line-height="6mm" -->
		<fo:list-item>
			<fo:list-item-label>
				<!-- <fo:block></fo:block> -->
				<fo:block/>
			</fo:list-item-label>
			<fo:list-item-body>
				<fo:block>
					<!--  
						<xsl:choose>
						<xsl:when test="../list/@listType = 'bulleted'">
						<fo:external-graphic src="{$baseMediaPdf}/pictos/puc_list.gif" scaling="non-uniform" alignment-adjust="0%"/>
						</xsl:when>
						<xsl:otherwise/>
						</xsl:choose>	
					-->
					<xsl:number/>
					<xsl:text>. </xsl:text>
					<xsl:apply-templates select="node()"/>
				</fo:block>
			</fo:list-item-body>
		</fo:list-item>
	</xsl:template>
	<!--  -->
	<xsl:template match="picture"/>
	<!--  -->
	<xsl:template match="text">
		<xsl:param name="taille-Texte"/>
		<xsl:param name="text-align"/>
		<xsl:param name="niveau"/>
		<xsl:param name="break"/>
		<xsl:param name="font-style"/>
		<xsl:variable name="align">
			<xsl:choose>
				<xsl:when test="$text-align =''">
					<xsl:value-of select="'left'"/>
				</xsl:when>
				<xsl:otherwise>
					<xsl:value-of select="$text-align"/>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>
		<xsl:variable name="taille">
			<xsl:choose>
				<xsl:when test="$taille-Texte =''">
					<xsl:value-of select="$variables/variables/contentpdfvar/formatage/font/niveau[@ref = 'paragraphe']/@size"/>
				</xsl:when>
				<xsl:otherwise>
					<xsl:value-of select="$taille-Texte"/>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>
		<xsl:choose>
			<xsl:when test="$break ='0'">
				<xsl:apply-templates select="node()">
					<xsl:with-param name="niveau" select="$niveau"/>
				</xsl:apply-templates>
				<xsl:text> </xsl:text>
			</xsl:when>
			<xsl:otherwise>
				<fo:block font-size="{$taille}" text-align="{$align}">
					<xsl:apply-templates select="node()">
						<xsl:with-param name="niveau" select="$niveau"/>
					</xsl:apply-templates>
				</fo:block>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<!--  -->
	<xsl:template match="italic">
		<fo:inline font-style="italic">
			<xsl:apply-templates select="node()"/>
		</fo:inline>
	</xsl:template>
	<xsl:template match="bold">
		<fo:inline font-weight="bold">
			<xsl:apply-templates select="node()"/>
		</fo:inline>
	</xsl:template>
	<!--  -->
	<xsl:template name="traitdate">
		<xsl:param name="date"/>
		<xsl:variable name="long">
			<xsl:value-of select="string-length($date)-5"/>
		</xsl:variable>
		<xsl:variable name="tail">
			<xsl:value-of select="substring($date , 5 ,$long)"/>
		</xsl:variable>
		<xsl:variable name="temp">
			<xsl:value-of select="substring($date , 6 ,$long)"/>
		</xsl:variable>
		<xsl:variable name="annee">
			<xsl:value-of select="substring-before($date , $tail)"/>
		</xsl:variable>
		<xsl:variable name="mois">
			<xsl:choose>
				<xsl:when test="string-length($temp)=5">
					<xsl:value-of select="substring($temp , 1,2)"/>
				</xsl:when>
				<xsl:otherwise>01</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>
		<xsl:variable name="jour">
			<xsl:choose>
				<xsl:when test="string-length($temp)=5">
					<xsl:value-of select="substring($temp , 4 ,2)"/>
				</xsl:when>
				<xsl:otherwise>01</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>
		<xsl:variable name="lemois">
			<xsl:choose>
				<xsl:when test="number($mois)=1">Janvier</xsl:when>
				<xsl:when test="number($mois)=2">Février</xsl:when>
				<xsl:when test="number($mois)=3">Mars</xsl:when>
				<xsl:when test="number($mois)=4">Avril</xsl:when>
				<xsl:when test="number($mois)=5">Mai</xsl:when>
				<xsl:when test="number($mois)=6">Juin</xsl:when>
				<xsl:when test="number($mois)=7">Juillet</xsl:when>
				<xsl:when test="number($mois)=8">Août</xsl:when>
				<xsl:when test="number($mois)=9">Septembre</xsl:when>
				<xsl:when test="number($mois)=10">Octobre</xsl:when>
				<xsl:when test="number($mois)=11">Novembre</xsl:when>
				<xsl:when test="number($mois)=12">Décembre</xsl:when>
			</xsl:choose>
		</xsl:variable> le <xsl:value-of select="$jour"/>
		<xsl:text>  </xsl:text>
		<xsl:value-of select="$lemois"/>
		<xsl:text>  </xsl:text>
		<xsl:value-of select="$annee"/>
	</xsl:template>

	<xsl:template match="orgUnitDescription">
		<xsl:apply-templates/>
	</xsl:template>

	<xsl:template match="subBlock">
		<xsl:param name="niveau"/>
		<xsl:param name="titre"/>
		<xsl:variable name="color">
			<xsl:choose>
				<xsl:when test="not($variables/variables/contentpdfvar/formatage/font/niveau[@ref=$niveau]/@color ='' )">
					<xsl:value-of select="$variables/variables/contentpdfvar/formatage/font/niveau[@ref=$niveau]/@color"/>
				</xsl:when>
				<xsl:otherwise>
					<xsl:value-of select="$couleur"/>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>
		<xsl:if test="not(normalize-space($titre)='')">
			????????<xsl:call-template name="titre">
				<xsl:with-param name="titre" select="$titre"/>
				<xsl:with-param name="niveau" select="$niveau"/>
			</xsl:call-template>
		</xsl:if>
		<fo:block
			font-size="{$variables/variables/contentpdfvar/formatage/font/niveau[@ref = 'paragraphe']/@size}" text-align="{$variables/variables/contentpdfvar/formatage/font/niveau[@ref = 'paragraphe']/@align}"
			text-indent="{$variables/variables/contentpdfvar/formatage/font/niveau[@ref = 'paragraphe']/@indent}" font-weight="{$variables/variables/contentpdfvar/formatage/font/niveau[@ref = 'paragraphe']/@weight}"
			font-family="{$variables/variables/contentpdfvar/formatage/font/niveau[@ref = 'paragraphe']/@family}" font-style="{$variables/variables/contentpdfvar/formatage/font/niveau[@ref = 'paragraphe']/@style}"
			color="{$variables/variables/contentpdfvar/formatage/font/niveau[@ref = 'paragraphe']/@color}">
			<fo:inline font-weight="bold" color="{$variables/variables/contentpdfvar/formatage/font/niveau[@ref = 'paragraphe']/@color}">
				<xsl:value-of select="$titre"/>
			</fo:inline>
			<xsl:apply-templates select="node()">
				<xsl:with-param name="niveau" select="$niveau"/>
			</xsl:apply-templates>
		</fo:block>
	</xsl:template>
	<!--  -->
	<xsl:template match="header">
		<xsl:param name="niveau"/>
		<xsl:param name="text-align"/>
		<!--  -->

		<xsl:variable name="color">
			<xsl:choose>
				<xsl:when test="not($variables/variables/contentpdfvar/formatage/font/niveau[@ref=$niveau]/@color ='' )">
					<xsl:value-of select="$variables/variables/contentpdfvar/formatage/font/niveau[@ref=$niveau]/@color"/>
				</xsl:when>
				<xsl:otherwise>
					<xsl:value-of select="$couleur"/>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>

		<xsl:if test="not(normalize-space(.) = '')">
			<xsl:comment>header de niveau <xsl:value-of select="$niveau"/> size(<xsl:value-of select="$variables/variables/contentpdfvar/formatage/font/niveau[@ref=$niveau]/@size"/>)</xsl:comment>
			<fo:block font-size="{$variables/variables/contentpdfvar/formatage/font/niveau[@ref=$niveau]/@size}" text-align="{$variables/variables/contentpdfvar/formatage/font/niveau[@ref=$niveau]/@align}" text-indent="{$variables/variables/contentpdfvar/formatage/font/niveau[@ref=$niveau]/@indent}"
				font-weight="{$variables/variables/contentpdfvar/formatage/font/niveau[@ref=$niveau]/@weight}" font-family="{$variables/variables/contentpdfvar/formatage/font/niveau[@ref=$niveau]/@family}" font-style="{$variables/variables/contentpdfvar/formatage/font/niveau[@ref=$niveau]/@style}"
				color="{$color}">
				<xsl:if test="$debugNiveau = '1'">
					<fo:inline font-size="8pt" font-weight="bold"> (<xsl:value-of select="$niveau"/>) </fo:inline>
				</xsl:if>
				<!-- <xsl:value-of select="."/> -->
				<xsl:apply-templates select="node()"/>
			</fo:block>
		</xsl:if>
	</xsl:template>
	<!--  -->
	<xsl:template match="webLink">
		<xsl:if test="$debug = '1'">
			<fo:block font-size="8pt" font-weight="bold" color="#f00"> (debug : Début webLink ) </fo:block>
		</xsl:if>
		<xsl:choose>
			<xsl:when test="not(normalize-space(./href) = '')">
				<xsl:variable name="intitule">
					<xsl:choose>
						<xsl:when test="not(normalize-space(./linkName) = '')">
							<xsl:value-of select="./linkName"/>
						</xsl:when>
						<xsl:otherwise>
							<xsl:value-of select="normalize-space(./href)"/>
						</xsl:otherwise>
					</xsl:choose>
				</xsl:variable>
				<xsl:variable name="href" select="./href"/>
				<fo:block font-size="12pt" font-weight="bold">Site web de la formation : <xsl:value-of select="$href"/><!--  <fo:basic-link external-destination="url({$href})" text-decoration="underline" color="{$variables/variables/contentpdfvar/formatage/couleurLiens/@color}">
					<xsl:value-of select="$intitule"/> 
				</fo:basic-link>--></fo:block>
			</xsl:when>
		</xsl:choose>
	</xsl:template>
	<!--  -->
	<xsl:template match="programName">
		<xsl:param name="niveau"/>
		<fo:block font-size="{$variables/variables/contentpdfvar/formatage/font/niveau[@ref = ($niveau + 1)]/@size}" color="{$couleur}" font-weight="bold">
			<xsl:apply-templates select="node()">
				<xsl:with-param name="niveau" select="$niveau"/>
			</xsl:apply-templates>
		</fo:block>
	</xsl:template>
	<!--  -->
	<xsl:template match="programDescription">
		<xsl:param name="niveau"/>
		<xsl:apply-templates select="node()">
			<xsl:with-param name="niveau" select="$niveau"/>
		</xsl:apply-templates>
	</xsl:template>
	<!-- qualification -->
	<xsl:template match="qualification">
		<xsl:param name="niveau"/>
		<xsl:if test="$debug = '1'">
			<fo:block font-size="8pt" font-weight="bold" color="#f00"> (debug : Début qualification ) </fo:block>
		</xsl:if>
		<xsl:apply-templates select="node()">
			<xsl:with-param name="niveau" select="$niveau"/>
		</xsl:apply-templates>
	</xsl:template>
	<!--  -->
	<xsl:template match="qualificationName">
		<xsl:if test="text/text()"><xsl:apply-templates select="node()"/></xsl:if>
	</xsl:template>
	<!--  -->
	<xsl:template match="qualificationDescription">
		<xsl:if test="not(normalize-space(.)='')">
			<xsl:apply-templates select="node()[position()=1]">
				<xsl:with-param name="titre" select="$variables/variables/contentpdfvar/contents/content[@type='qualificationDescription']/value[@lang=$_langPdf]"/>
			</xsl:apply-templates>
			<xsl:apply-templates select="node()[not(position()=1)]"/>
		</xsl:if>
	</xsl:template>
	<!--  -->
	<xsl:template match="credits">
		<xsl:variable name="credits">
			<xsl:choose>
				<xsl:when test="not(./@ECTScredits ='')">
					<xsl:value-of select="normalize-space(./@ECTScredits)"/>
				</xsl:when>
				<xsl:otherwise>
					<xsl:value-of select="normalize-space(.)"/>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>
		<!-- <xsl:if test="not($credits = '')">
			<xsl:value-of select="$variables/variables/contentpdfvar/contents/content[@type ='credits']/value[@lang = $_langPdf]"/>
			<xsl:text> </xsl:text>
			<xsl:value-of select="$credits"/>
			<xsl:text> </xsl:text>
			<xsl:value-of select="$variables/variables/contentpdfvar/contents/content[@type ='credits2']/value[@lang = $_langPdf]"/>
		</xsl:if>-->
	</xsl:template>
	<!--  -->
	<xsl:template match="profession">
		<xsl:param name="niveau"/>
		<xsl:if test="not(normalize-space(.)='')">
			<fo:block>
				<fo:inline font-weight="bold">
					<xsl:value-of select="$variables/variables/contentpdfvar/contents/content[@type='profession']/value[@lang=$_langPdf]"/>
				</fo:inline>
			
				<xsl:apply-templates select="node()">
					<xsl:with-param name="niveau" select="$niveau"/>
				</xsl:apply-templates>
			</fo:block>
		</xsl:if>
		
	</xsl:template>
	<!--  -->
	<xsl:template match="studyQualification">
		<xsl:param name="niveau"/>
		ca donne quoi ce truc ?
		<xsl:if test="not(normalize-space(.)='')">
			<fo:block>
			<fo:inline font-weight="bold">
				<xsl:value-of select="$variables/variables/contentpdfvar/contents/content[@type='studyQualification']/value[@lang=$_langPdf]"/>
			</fo:inline>
			<xsl:apply-templates select="node()">
				<xsl:with-param name="niveau" select="$niveau"/>
			</xsl:apply-templates>
			</fo:block>
		</xsl:if>
	</xsl:template>
	<!--  -->
	<xsl:template match="degree"/>
	<!-- fin qualification -->
	<!--  -->
	<xsl:template match="level">
		<!-- <xsl:if test="$debug = '1'">
			<fo:block font-size="8pt" font-weight="bold" color="#f00"> (debug : Début level ) </fo:block>
		</xsl:if>
		<xsl:variable name="aaa" select="normalize-space(.)"/>
		<xsl:variable name="typeForm" select="normalize-space($variables/variables/contentpdfvar/formations/formation[degree = normalize-space($aaa)]/libelle)"/>
		<xsl:choose>
			<xsl:when test="not($aaa = '')">
				<fo:block>
					<fo:inline font-weight="bold">
						<xsl:value-of select="$variables/variables/contentpdfvar/contents/content[@type='level']/value[@lang=$_langPdf]"/>
					</fo:inline>
					<xsl:choose>
						<xsl:when test="not($typeForm = '')">
							<xsl:value-of select="$typeForm"/>
						</xsl:when>
						<xsl:otherwise>
							<xsl:apply-templates select="node()"/>
						</xsl:otherwise>
					</xsl:choose>				
				</fo:block>
			</xsl:when>
		</xsl:choose> -->
	</xsl:template>
	<!--  -->
	<xsl:template match="learningObjectives">
		<xsl:param name="niveau"/>
		<xsl:if test="$debug = '1'">
			<fo:block font-size="8pt" font-weight="bold" color="#f00"> (debug : Début learningObjectives ) </fo:block>
		</xsl:if>
		<xsl:if test="not(normalize-space(.)='')">
			<fo:block>
				<fo:inline font-weight="bold">
				<xsl:value-of select="$variables/variables/contentpdfvar/contents/content[@type ='learningObjectives']/value[@lang = $_langPdf]"/>
				</fo:inline>
			<xsl:apply-templates select="node()">
				<xsl:with-param name="niveau" select="$niveau"/>
			</xsl:apply-templates>
			</fo:block>
		</xsl:if>
	</xsl:template>
	<!-- -->
	<xsl:template match="admissionInfo">
		<xsl:param name="niveau"/>
		<xsl:if test="$debug = '1'">
			<fo:block font-size="8pt" font-weight="bold" color="#f00"> (debug : Début admissionInfo ) </fo:block>
		</xsl:if>
		<xsl:apply-templates select="node()">
			<xsl:with-param name="niveau" select="$niveau"/>
		</xsl:apply-templates>
	</xsl:template>
	<!--  -->
	<xsl:template match="teachingStart">
		<xsl:param name="niveau"/>
		<fo:block>
			<fo:inline font-weight="bold">
				<xsl:value-of select="$variables/variables/contentpdfvar/contents/content[@type='teachingStart']/value[@lang=$_langPdf]"/>
			</fo:inline>
		<xsl:if test="$debug = '1'">
			<fo:block font-size="8pt" font-weight="bold" color="#f00"> (debug : Début teachingStart ) </fo:block>
		</xsl:if>
		<xsl:apply-templates select="node()">
			<xsl:with-param name="niveau" select="$niveau"/>
		</xsl:apply-templates>
		</fo:block>
	</xsl:template>
	<!--  -->
	<xsl:template match="registrationDeadline">
		<xsl:param name="niveau"/>
		<xsl:if test="$debug = '1'">
			<fo:block font-size="8pt" font-weight="bold" color="#f00"> (debug : Début registrationDeadline ) </fo:block>
		</xsl:if>
		<fo:block>
			<fo:inline font-weight="bold">
				<xsl:value-of select="$variables/variables/contentpdfvar/contents/content[@type='registrationDeadline']/value[@lang=$_langPdf]"/>
			</fo:inline>
		<xsl:apply-templates select="node()">
			<xsl:with-param name="niveau" select="$niveau"/>
		</xsl:apply-templates>
		</fo:block>
	</xsl:template>
	<!--  -->
	<xsl:template match="admissionDescription">
		<xsl:param name="niveau"/>
		<xsl:apply-templates select="node()">
			<xsl:with-param name="niveau" select="$niveau"/>
		</xsl:apply-templates>
	</xsl:template>
	<!--  -->
	<xsl:template match="studentPlaces">
		<xsl:param name="niveau"/>
		<xsl:if test="$debug = '1'">
			<fo:block font-size="8pt" font-weight="bold" color="#f00"> (debug : Début studentPlaces ) </fo:block>
		</xsl:if>
		<xsl:variable name="place" select="normalize-space(./@places)"></xsl:variable>
		<xsl:choose>
			<xsl:when test="not($place ='')">
				<xsl:value-of select="$variables/variables/contentpdfvar/contents/content[@type ='studentPlaces']/value[@lang = $_langPdf]"/>
				<xsl:text> </xsl:text>
				<xsl:value-of select="./@places"/>
				<xsl:value-of select="$variables/variables/contentpdfvar/contents/content[@type ='ponctuation']/value[@type ='point']"/>
			</xsl:when>
		</xsl:choose>
	</xsl:template>
	<!-- fin admissionInfo -->
	<!--  -->
	<xsl:template match="recommendedPrerequisites">
		<xsl:param name="niveau"/>
		<xsl:if test="$debug = '1'">
			<fo:block font-size="8pt" font-weight="bold" color="#f00"> (debug : Début recommendedPrerequisites ) </fo:block>
		</xsl:if>
		<xsl:if test="not(normalize-space(.)='')">
			<fo:block>
				<fo:inline font-weight="bold">
					<xsl:value-of select="$variables/variables/contentpdfvar/contents/content[@type ='recommendedPrerequisites']/value[@lang = $_langPdf]"/>
				</fo:inline>
			<xsl:apply-templates select="node()">
				<xsl:with-param name="niveau" select="$niveau"/>
			</xsl:apply-templates>
			</fo:block>
		</xsl:if>
	</xsl:template>
	<!--  -->
	<xsl:template match="formalPrerequisites">
		<xsl:param name="niveau"/>
		<xsl:if test="$debug = '1'">
			<fo:block font-size="8pt" font-weight="bold" color="#f00"> (debug : Début formalPrerequisites ) </fo:block>
		</xsl:if>
		<xsl:if test="not(normalize-space(.)='')">
			<fo:block>
				<fo:inline font-weight="bold">
					<xsl:value-of select="$variables/variables/contentpdfvar/contents/content[@type ='formalPrerequisites']/value[@lang = $_langPdf]"/>
				</fo:inline>
				<xsl:apply-templates select="node()">
					<xsl:with-param name="niveau" select="$niveau"/>
				</xsl:apply-templates>
			</fo:block>
		</xsl:if>
	</xsl:template>
	<!--  -->
	<xsl:template match="teachingPlace">
		<!-- <xsl:if test="$debug = '1'">
			<fo:block font-size="8pt" font-weight="bold" color="#f00"> (debug : Début teachingPlace ) </fo:block>
		</xsl:if>
		<xsl:if test="not(normalize-space(.)='')">
			<fo:inline font-size="8pt" font-weight="bold">
				<xsl:value-of select="$variables/variables/contentpdfvar/contents/content[@type ='teachingPlace']/value[@lang = $_langPdf]"/>
			</fo:inline>
			<xsl:apply-templates select="node()"/>
		</xsl:if> -->
	</xsl:template>
	<xsl:template match="extadr">
		<xsl:if test="not(normalize-space(.) = '')">
			<xsl:value-of select="$variables/variables/contentpdfvar/contents/content[@type ='extadr']/value[@lang = $_langPdf]"/>
			<xsl:apply-templates select="."/>
		</xsl:if>
	</xsl:template>
	<!--  -->
	<xsl:template match="telephone">
		<xsl:if test="not(normalize-space(.) = '')">
			<xsl:value-of select="$variables/variables/contentpdfvar/contents/content[@type ='telephone']/value[@lang = $_langPdf]"/>
			<xsl:apply-templates select="."/>
		</xsl:if>
	</xsl:template>
	<!--  -->
	<xsl:template match="fax">
		<xsl:if test="not(normalize-space(.) = '')">
			<xsl:value-of select="$variables/variables/contentpdfvar/contents/content[@type ='fax']/value[@lang = $_langPdf]"/>
			<xsl:apply-templates select="."/>
		</xsl:if>
	</xsl:template>
	<!--  -->
	<xsl:template match="email">
		<xsl:apply-templates select="node()"/>
	</xsl:template>
	<!--  -->
	<xsl:template match="formOfTeaching">
		<xsl:param name="niveau"/>
		<xsl:if test="$debug = '1'">
			<fo:block font-size="8pt" font-weight="bold" color="#f00"> (debug : Début formOfTeaching ) </fo:block>
		</xsl:if>
		<xsl:if test="not(normalize-space(.)='')">
			<fo:block>
				<fo:inline font-weight="bold">
					<xsl:value-of select="$variables/variables/contentpdfvar/contents/content[@type ='formOfTeaching']/value[@lang = $_langPdf]"/>
				</fo:inline>
				<xsl:apply-templates select="node()">
					<xsl:with-param name="niveau" select="$niveau"/>
				</xsl:apply-templates>
			</fo:block>
		</xsl:if>
	</xsl:template>
	<!--  -->
	<xsl:template match="programDuration">
		<xsl:param name="niveau"/>
		<xsl:if test="$debug = '1'">
			<fo:block font-size="8pt" font-weight="bold" color="#f00"> (debug : Début programDuration ) </fo:block>
		</xsl:if>
		<xsl:if test="not(normalize-space(.)='')">
			<fo:inline font-weight="bold">
				<xsl:value-of select="$variables/variables/contentpdfvar/contents/content[@type ='programDuration']/value[@lang = $_langPdf]"/>
			</fo:inline>
			<xsl:apply-templates select="node()">
				<xsl:with-param name="niveau" select="$niveau"/>
			</xsl:apply-templates>
		</xsl:if>
	</xsl:template>
	<!--  -->
	<xsl:template match="programStructure">
		<xsl:param name="niveau"/>
		<xsl:if test="$debug = '1'">
			<fo:block font-size="8pt" font-weight="bold" color="#f00"> (debug : Début programStructure ) niveau <xsl:value-of select="$niveau"/>
			</fo:block>
		</xsl:if>
		<xsl:choose>
			<xsl:when test="local-name(*[position()=1])='subBlock'">
				<xsl:apply-templates select="node()">
					<xsl:with-param name="niveau" select="$niveau"/>
				</xsl:apply-templates>
			</xsl:when>
			<xsl:otherwise>
				<xsl:apply-templates select="descendant::refProgram[position()=1] | descendant::refCourse[position()=1]">
					<xsl:with-param name="niveau" select="$niveau"/>
					<xsl:with-param name="titreApres" select="descendant::header[position()=1]"/>
				</xsl:apply-templates>
				<xsl:apply-templates select="descendant::refProgram[not(position()=1)] | descendant::refCourse[not(position()=1)]">
					<xsl:with-param name="niveau" select="$niveau"/>
				</xsl:apply-templates>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<!-- regulations Réglement -->
	<!--  -->
	<xsl:template match="regulations">
		<xsl:param name="niveau"/>
		<xsl:if test="$debug = '1'">
			<fo:block font-size="8pt" font-weight="bold" color="#f00"> (debug : Début regulations ) </fo:block>
		</xsl:if>
		<xsl:apply-templates select="node()">
			<xsl:with-param name="niveau" select="$niveau"/>
		</xsl:apply-templates>
	</xsl:template>
	<!--  -->
	<xsl:template match="studyAbroad">
		<xsl:param name="niveau"/>
		<xsl:if test="$debug = '1'">
			<fo:block font-size="8pt" font-weight="bold" color="#f00"> (debug : Début studyAbroad ) </fo:block>
		</xsl:if>
		<xsl:if test="not(normalize-space(.)='')">
			<fo:inline font-weight="bold">
				<xsl:value-of select="$variables/variables/contentpdfvar/contents/content[@type ='studyAbroad']/value[@lang = $_langPdf]"/>
			</fo:inline>
			<xsl:apply-templates select="node()">
				<xsl:with-param name="niveau" select="$niveau"/>
			</xsl:apply-templates>
		</xsl:if>
	</xsl:template>
	<!--  -->
	<xsl:template match="expenses">
		<xsl:param name="niveau"/>
		<xsl:if test="$debug = '1'">
			<fo:block font-size="8pt" font-weight="bold" color="#f00"> (debug : Début expenses ) </fo:block>
		</xsl:if>
		<xsl:apply-templates select="node()">
			<xsl:with-param name="niveau" select="$niveau"/>
		</xsl:apply-templates>
	</xsl:template>
	<!--  -->
	<xsl:template match="universalAdjustment">
		<xsl:param name="niveau"/>
		<xsl:if test="$debug = '1'">
			<fo:block font-size="8pt" font-weight="bold" color="#f00"> (debug : Début universalAdjustment ) </fo:block>
		</xsl:if>
		<xsl:apply-templates select="node()">
			<xsl:with-param name="niveau" select="$niveau"/>
		</xsl:apply-templates>
	</xsl:template>
	<!--  -->
	<xsl:template match="contacts">
		<xsl:param name="niveau"/>
		<xsl:if test="$debug = '1'">
			<fo:block font-size="8pt" font-weight="bold" color="#f00"> (debug : Début contacts ) </fo:block>
		</xsl:if>
		<fo:block keep-together="always">
		<xsl:apply-templates select="node()">
			<xsl:with-param name="niveau" select="$niveau"/>
		</xsl:apply-templates>
		</fo:block>
	</xsl:template>
	<!--  -->
	<xsl:template match="infoBlock">
		<xsl:param name="niveau"/>
		<xsl:apply-templates select="node()">
			<xsl:with-param name="niveau" select="$niveau"/>
		</xsl:apply-templates>
	</xsl:template>

	<!-- subProgram -->
	<xsl:template match="subProgram">
		<xsl:param name="niveau"/>
		<xsl:param name="titreApres"/>
		<fo:block keep-together="always">
		<xsl:choose>
			<xsl:when test="$_suiteSubProgram ='1'">
				<xsl:if test="not(normalize-space($titreApres)='')">
					<xsl:call-template name="titre">
						<xsl:with-param name="titre" select="$titreApres"/>
						<xsl:with-param name="niveau" select="$niveau"/>
					</xsl:call-template>
				</xsl:if>
				<xsl:apply-templates select="node()">
					<xsl:with-param name="niveau" select="$niveau + 1"/>
				</xsl:apply-templates>
			</xsl:when>
			<xsl:otherwise> (Contenu non développé) </xsl:otherwise>
		</xsl:choose>
		</fo:block>
	</xsl:template>

	<!-- ****************************** course  ************************** -->
	<xsl:template match="course">
		<xsl:param name="niveau"/>
		<xsl:param name="titre"/>
		<fo:block keep-together="always" space-before="{$variables/variables/contentpdfvar/formatage/distancEntreCourses/@select}mm">	
			<xsl:if test="not(normalize-space($titre)='')">
				<xsl:call-template name="titre">
					<xsl:with-param name="titre" select="$titre"/>
					<xsl:with-param name="niveau" select="$niveau"/>
				</xsl:call-template>
			</xsl:if>
			<xsl:apply-templates select="node()">
				<xsl:with-param name="niveau" select="$niveau +1"/>
			</xsl:apply-templates>
		</fo:block>
	</xsl:template>
	<!--  -->
	<xsl:template match="courseName">
		<xsl:param name="titre"/>
		<xsl:param name="niveau"/>
		<xsl:variable name="titreEtCredits">* <xsl:value-of select="text/text()"/> (<xsl:value-of select="../credits/@ECTScredits"/> crédits)</xsl:variable>
		<xsl:if test="not(normalize-space($titre)='')">
			<xsl:call-template name="titre">
				<xsl:with-param name="titre" select="$titre"/>
				<xsl:with-param name="niveau" select="$niveau"/>
			</xsl:call-template>
		</xsl:if>
		<xsl:call-template name="titre">
			<xsl:with-param name="titreApres" select="$titreEtCredits"/>
			<xsl:with-param name="niveau">paragraphe</xsl:with-param>
		</xsl:call-template>
	</xsl:template>
	<!--  -->
	<xsl:template match="courseDescription">
		<xsl:param name="niveau"/>
		<xsl:apply-templates select="node()">
			<xsl:with-param name="niveau" select="$niveau"/>
		</xsl:apply-templates>
	</xsl:template>
	<!--  -->
	<xsl:template match="teachingTerm">
		<xsl:param name="niveau"/>
		<xsl:apply-templates select="node()">
			<xsl:with-param name="niveau" select="$niveau"/>
		</xsl:apply-templates>
	</xsl:template>
	<!--  -->
	<xsl:template match="exam">
		<xsl:param name="niveau"/>
		<xsl:apply-templates select="node()">
			<xsl:with-param name="niveau" select="$niveau"/>
		</xsl:apply-templates>
	</xsl:template>
	<!--  -->
	<xsl:template match="examDuration">
		<fo:inline font-weight="bold">
			<xsl:value-of select="$variables/variables/contentpdfvar/contents/content[@type ='examDuration']/value[@lang = $_langPdf]"/>
		</fo:inline>
		<xsl:value-of select="./@duration"/>
	</xsl:template>
	<!--  -->
	<xsl:template match="infoBlock[@userDefined ='Examens']">
		<xsl:param name="niveau"/>
		<xsl:apply-templates select="node()">
			<xsl:with-param name="niveau" select="$niveau"/>
		</xsl:apply-templates>
	</xsl:template>
	<!--  -->
	<xsl:template match="subBlock[@userDefined ='examensCc']">
		<xsl:if test="not(normalize-space(.) = '')">
			<fo:block>
				<xsl:value-of select="$variables/variables/contentpdfvar/contents/content[@type ='examensCc']/value[@lang = $_langPdf]"/>
			</fo:block>
		</xsl:if>
	</xsl:template>
	<!--  -->
	<xsl:template match="subBlock[@userDefined ='examensDs']">
		<xsl:if test="not(normalize-space(.) = '')">
			<fo:block>
				<xsl:value-of select="$variables/variables/contentpdfvar/contents/content[@type ='examensDs']/value[@lang = $_langPdf]"/>
			</fo:block>
		</xsl:if>
	</xsl:template>
	<!--  -->
	<xsl:template match="subBlock[@userDefined ='examensExa']">
		<xsl:if test="not(normalize-space(.) = '')">
			<fo:block>
				<xsl:value-of select="$variables/variables/contentpdfvar/contents/content[@type ='examensExa']/value[@lang = $_langPdf]"/>
			</fo:block>
		</xsl:if>
	</xsl:template>
	<!--  -->
	<xsl:template match="subBlock[@userDefined ='examensOral']">
		<xsl:if test="not(normalize-space(.) = '')">
			<fo:block>
				<xsl:value-of select="$variables/variables/contentpdfvar/contents/content[@type ='examensOral']/value[@lang = $_langPdf]"/>
			</fo:block>
		</xsl:if>
	</xsl:template>
	<!--  -->
	<xsl:template match="subBlock[@userDefined ='examensTp']">
		<xsl:if test="not(normalize-space(.) = '')">
			<fo:block>
				<xsl:value-of select="$variables/variables/contentpdfvar/contents/content[@type ='examensTp']/value[@lang = $_langPdf]"/>
			</fo:block>
		</xsl:if>
	</xsl:template>
	<!--  -->
	<xsl:template match="subBlock[@userDefined ='examensDuree1']">
		<xsl:if test="not(normalize-space(.) = '')">
			<fo:block>
				<xsl:value-of select="$variables/variables/contentpdfvar/contents/content[@type ='examensDuree1']/value[@lang = $_langPdf]"/>
				<xsl:value-of select="."/>
				<xsl:value-of select="$variables/variables/contentpdfvar/contents/content[@type ='uniteDuree']/value[@lang = $_langPdf]"/>
			</fo:block>
		</xsl:if>
	</xsl:template>
	<!--  -->
	<xsl:template match="subBlock[@userDefined ='examensDuree2']">
		<xsl:if test="not(normalize-space(.) = '')">
			<fo:block>
				<xsl:value-of select="$variables/variables/contentpdfvar/contents/content[@type ='examensDuree2']/value[@lang = $_langPdf]"/>
				<xsl:value-of select="."/>
				<xsl:value-of select="$variables/variables/contentpdfvar/contents/content[@type ='uniteDuree']/value[@lang = $_langPdf]"/>
			</fo:block>
		</xsl:if>
	</xsl:template>
	<!--  -->
	<xsl:template match="teachingActivity">
		<xsl:param name="niveau"/>
		<xsl:apply-templates select="node()">
			<xsl:with-param name="niveau" select="$niveau"/>
		</xsl:apply-templates>
	</xsl:template>
	<!--  -->
	<xsl:template match="subBlock[@userDefined ='volumeHoraireCours']">
		<xsl:if test="not(normalize-space(.) = '')">
			<fo:block>
				<xsl:value-of select="$variables/variables/contentpdfvar/contents/content[@type ='volumeHoraireCours']/value[@lang = $_langPdf]"/>
				<xsl:value-of select="."/>
			</fo:block>
		</xsl:if>
	</xsl:template>
	<!--  -->
	<xsl:template match="subBlock[@userDefined ='volumeHoraireTd']">
		<xsl:if test="not(normalize-space(.) = '')">
			<fo:block>
				<xsl:value-of select="$variables/variables/contentpdfvar/contents/content[@type ='volumeHoraireTd']/value[@lang = $_langPdf]"/>
				<xsl:value-of select="."/>
			</fo:block>
		</xsl:if>
	</xsl:template>
	<!--  -->
	<xsl:template match="subBlock[@userDefined ='volumeHoraireTp']">
		<xsl:if test="not(normalize-space(.) = '')">
			<fo:block>
				<xsl:value-of select="$variables/variables/contentpdfvar/contents/content[@type ='volumeHoraireTp']/value[@lang = $_langPdf]"/>
				<xsl:value-of select="."/>
			</fo:block>
		</xsl:if>
	</xsl:template>
	<!--  -->
	<xsl:template match="subBlock[@userDefined ='volumeHoraireTutorat']">
		<xsl:if test="not(normalize-space(.) = '')">
			<fo:block>
				<xsl:value-of select="$variables/variables/contentpdfvar/contents/content[@type ='volumeHoraireTutorat']/value[@lang = $_langPdf]"/>
				<xsl:value-of select="."/>
			</fo:block>
		</xsl:if>
	</xsl:template>
	<!--  -->
	<xsl:template match="subBlock[@userDefined ='volumeHoraireCourstd']">
		<xsl:if test="not(normalize-space(.) = '')">
			<fo:block>
				<xsl:value-of select="$variables/variables/contentpdfvar/contents/content[@type ='volumeHoraireCourstd']/value[@lang = $_langPdf]"/>
				<xsl:value-of select="."/>
			</fo:block>
		</xsl:if>
	</xsl:template>
	<!-- ****************************** FIN course  ************************** -->
	<!-- ****************************** person ************************** -->
	<xsl:template match="person">
		<xsl:param name="niveau"/>
		<xsl:param name="role"/>
		<fo:block space-before="{$variables/variables/contentpdfvar/formatage/distancEntrePerson/@select}mm">
		<xsl:choose>
			<xsl:when test="$_detailPerson = 1">
				<fo:block>
					<fo:inline font-weight="bold">
						<xsl:value-of select="$role"/> :
					</fo:inline>
					<xsl:value-of select="./name/family"/><xsl:text>  </xsl:text><xsl:value-of select="./name/given"/> 
				</fo:block>
				<xsl:if test="not(normalize-space(./contactData/telephone) = '')">
					<fo:block>
						<fo:inline font-weight="bold">
							<xsl:value-of select="$variables/variables/contentpdfvar/contents/content[@type ='telephone']/value[@lang = $_langPdf]"/>
						</fo:inline>
						<xsl:value-of select="./contactData/telephone"/>
					</fo:block>
				</xsl:if>
				<xsl:if test="not(normalize-space(./contactData/fax) = '')">
					<fo:block>
						<fo:inline font-weight="bold">
							<xsl:value-of select="$variables/variables/contentpdfvar/contents/content[@type ='fax']/value[@lang = $_langPdf]"/>
						</fo:inline>
						<xsl:value-of select="./contactData/fax"/>
					</fo:block>
				</xsl:if>
				<xsl:if test="not(normalize-space(./contactData/email) = '')">
					<fo:block>
						<fo:inline font-weight="bold">
							<xsl:value-of select="$variables/variables/contentpdfvar/contents/content[@type ='email']/value[@lang = $_langPdf]"/>
						</fo:inline>
						<xsl:value-of select="./contactData/email"/>
					</fo:block>
				</xsl:if>
			</xsl:when>
			<xsl:otherwise>
				<xsl:value-of select="$variables/variables/contentpdfvar/contents/content[@type ='person']/value[@lang = $_langPdf]"/>
				<xsl:apply-templates select="./name/family"/><xsl:text>  </xsl:text><xsl:value-of select="./name/given"/>
			</xsl:otherwise>
		</xsl:choose>
			</fo:block>
	</xsl:template>
	<!-- ****************************** FIN person  ************************** -->
	<!--  -->
	<xsl:template match="refPerson">
		<xsl:param name="niveau"/>
		<xsl:variable name="ref" select="./@ref"/>
		<xsl:apply-templates select="//*[(@id = $ref) or (@ident = $ref)]">	
			<xsl:with-param name="role" select="@role"/>
			<xsl:with-param name="niveau" select="$niveau"/>
		</xsl:apply-templates>
	</xsl:template>
	<!--  -->
	<xsl:template match="refProgram">
		<xsl:param name="niveau"/>
		<xsl:param name="titreApres"/>
		<xsl:if test="$debug = '1'">
			<fo:block font-size="8pt" font-weight="bold" color="#f00"> (debug : Début refProgram pos 1 ) niveau <xsl:value-of select="$niveau"/> titreApres =<xsl:value-of select="$titreApres"/>
			</fo:block>
		</xsl:if>
		<xsl:variable name="id" select="./@ref"/>
		<xsl:apply-templates select="//*[@id = $id ]">
			<xsl:with-param name="niveau" select="$niveau"/>
			<xsl:with-param name="titreApres" select="$titreApres"/>
		</xsl:apply-templates>
	</xsl:template>
	<!--  
	<xsl:template match="refProgram[not(position()=1)]">
		<xsl:param name="niveau"/>
		<xsl:if test="$debug = '1'">
			<fo:block font-size="8pt" font-weight="bold" color="#f00"> (debug : Début refProgram suite ) niveau <xsl:value-of select="$niveau"/>
			</fo:block>
		</xsl:if>
		<xsl:variable name="id" select="./@ref"/>
		<xsl:if test="$debug = '1'"> {{debut <xsl:value-of select="local-name(//*[@id = $id ])"/>}} </xsl:if>
		<xsl:apply-templates select="//*[@id = $id ]">
			<xsl:with-param name="niveau" select="$niveau"/>
		</xsl:apply-templates>
	</xsl:template>-->
	<!--  -->
	<xsl:template match="refCourse">
		<xsl:param name="niveau"/>
		<xsl:param name="titre"/>
		<xsl:variable name="id" select="./@ref"/>
		<xsl:choose>
			<xsl:when test="$_traiteCourse =''"/>
			<xsl:when test="$_traiteCourse ='1'">
				<xsl:apply-templates select="//course[(@id = $id) and (position()=1)]/courseName">
					<xsl:with-param name="niveau" select="$niveau"/>
					<xsl:with-param name="titre" select="$titre"/>
				</xsl:apply-templates>
				<xsl:apply-templates select="//course[(@id = $id) and (not(position()=1))]/courseName">
					<xsl:with-param name="niveau" select="$niveau"/>
					<xsl:with-param name="titre" select="$titre"/>
				</xsl:apply-templates>
			</xsl:when>
			<xsl:otherwise>
				<xsl:apply-templates select="//course[(@id = $id) and (position()=1)]">
					<xsl:with-param name="niveau" select="$niveau"/>
					<xsl:with-param name="titre" select="$titre"/>
				</xsl:apply-templates>
				<xsl:apply-templates select="//course[(@id = $id) and (not(position()=1))]">
					<xsl:with-param name="niveau" select="$niveau"/>
				</xsl:apply-templates>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<!--  -->
	<xsl:template match="program">
		<xsl:param name="niveau"/>
		<xsl:param name="titreApres"/>
		
		<!-- break-after="page"  keep-together="always"-->
		<fo:block break-before="page">
			<xsl:if test="$debug = 1">[[[PROG <xsl:value-of select="$niveau"/>]]] titre =(<xsl:value-of select="$titreApres"/>)</xsl:if>
			<!-- la disposition de l'élément programStructure au milieu des autre et non à la fin oblige à nommer les templates à traiter -->
			<!-- Titre de la formation -->
			<fo:block font-size="{$variables/variables/contentpdfvar/formatage/font/niveau[@ref = '1']/@size}" color="{$couleur}" text-align="center" font-weight="bold">
				<xsl:apply-templates select="programName/text">
					<xsl:with-param name="taille-Texte">20</xsl:with-param>
					<xsl:with-param name="text-align">center</xsl:with-param>
					<xsl:with-param name="break" select="1"/>
				</xsl:apply-templates>
			</fo:block>
			<fo:block space-before="1cm" font-size="12pt" color="{$couleur}" >
				* <xsl:value-of select="qualification/credits/@ECTScredits"/> crédits
			</fo:block>
			<fo:block font-size="12pt" color="{$couleur}" >
				* <xsl:value-of select="number(/CDM/program[position()=1]/qualification/credits/@ECTScredits) div 30"/> Semestres
			</fo:block>
			<fo:block space-before="1cm" font-size="12pt" color="{$couleur}"/>
			<!-- Description de la formation -->
			<xsl:apply-templates select="programDescription">
				<xsl:with-param name="niveau" select="$niveau + 1"/>
			</xsl:apply-templates>
			<!-- -->
			<xsl:apply-templates select="learningObjectives">
				<xsl:with-param name="niveau" select="$niveau + 1"/>
			</xsl:apply-templates>
			<!-- -->
			<xsl:apply-templates select="recommendedPrerequisites">
				<xsl:with-param name="niveau" select="$niveau + 1"/>
			</xsl:apply-templates>
			<!-- -->
			<xsl:apply-templates select="formalPrerequisites">
				<xsl:with-param name="niveau" select="$niveau + 1"/>
			</xsl:apply-templates>
			<!--  -->
			<xsl:if test="$debug = '1'">
				<fo:block font-size="8pt" font-weight="bold" color="#f00"> (debug : Début qualification ) </fo:block>
			</xsl:if>
			<!-- <xsl:apply-templates select="qualification">
				<xsl:with-param name="niveau" select="$niveau + 1"/>
			</xsl:apply-templates> -->
			<!--  	-->
			<xsl:apply-templates select="level">
				<xsl:with-param name="niveau" select="$niveau + 1"/>
			</xsl:apply-templates>
			
			<!-- -->
			<xsl:apply-templates select="admissionInfo">
				<xsl:with-param name="niveau" select="$niveau + 1"/>
			</xsl:apply-templates>
			
			<!-- -->
			<xsl:apply-templates select="teachingPlace">
				<xsl:with-param name="niveau" select="$niveau + 1"/>
			</xsl:apply-templates>
			<!-- -->
			<xsl:apply-templates select="formOfTeaching">
				<xsl:with-param name="niveau" select="$niveau + 1"/>
			</xsl:apply-templates>
			<!-- -->
			<xsl:apply-templates select="programDuration">
				<xsl:with-param name="niveau" select="$niveau + 1"/>
			</xsl:apply-templates>
			<!-- -->
			<xsl:apply-templates select="regulations">
				<xsl:with-param name="niveau" select="$niveau + 1"/>
			</xsl:apply-templates>
			<!-- -->
			<xsl:apply-templates select="studyAbroad">
				<xsl:with-param name="niveau" select="$niveau + 1"/>
			</xsl:apply-templates>
			<!-- -->
			<xsl:apply-templates select="expenses">
				<xsl:with-param name="niveau" select="$niveau + 1"/>
			</xsl:apply-templates>
			<!-- -->
			<xsl:apply-templates select="universalAdjustment">
				<xsl:with-param name="niveau" select="$niveau + 1"/>
			</xsl:apply-templates>
			<!-- -->
			<xsl:apply-templates select="contacts">
				<xsl:with-param name="niveau" select="$niveau + 1"/>
			</xsl:apply-templates>
			<!-- -->
			<xsl:apply-templates select="webLink">
				<xsl:with-param name="niveau" select="$niveau + 1"/>
			</xsl:apply-templates>
			<!-- ici traitement à mettre pour autres templates -->
		</fo:block>
		<xsl:if test="$_suiteProgramStructure = 1">
			<xsl:if test="local-name(key('cdmObj', programStructure/refProgram/@ref))='program'">
				<fo:block font-style="bold" space-before="1cm">Voir les différents parcours ou spécialités :</fo:block>
				<xsl:for-each select="programStructure/refProgram/@ref">
					<fo:block font-style="italic">* <xsl:apply-templates select="key('cdmObj', .)/programName/text"><xsl:with-param name="break">0</xsl:with-param></xsl:apply-templates></fo:block>
				</xsl:for-each>
			</xsl:if>
			<xsl:apply-templates select="programStructure">
			<xsl:with-param name="niveau" select="$niveau + 1"/>
		</xsl:apply-templates>
		</xsl:if>
	</xsl:template>
	<!--  -->
<xsl:template name="titre">
	<xsl:param name="titreApres"/>
	<xsl:param name="niveau"/>
	<xsl:variable name="color">
		<xsl:choose>
			<xsl:when test="not($variables/variables/contentpdfvar/formatage/font/niveau[@ref=$niveau]/@color ='' )">
				<xsl:value-of select="$variables/variables/contentpdfvar/formatage/font/niveau[@ref=$niveau]/@color"/>
			</xsl:when>
			<xsl:otherwise>
				<xsl:value-of select="$couleur"/>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:variable>
	<xsl:if test="$debug = 1">debut template titre niveau (<xsl:value-of select="$niveau"/>)</xsl:if>
	<fo:block font-size="{$variables/variables/contentpdfvar/formatage/font/niveau[@ref=$niveau]/@size}" text-align="{$variables/variables/contentpdfvar/formatage/font/niveau[@ref=$niveau]/@align}" text-indent="{$variables/variables/contentpdfvar/formatage/font/niveau[@ref=$niveau]/@indent}"
		font-weight="{$variables/variables/contentpdfvar/formatage/font/niveau[@ref=$niveau]/@weight}" font-family="{$variables/variables/contentpdfvar/formatage/font/niveau[@ref=$niveau]/@family}" font-style="{$variables/variables/contentpdfvar/formatage/font/niveau[@ref=$niveau]/@style}"
		color="{$color}">
		<xsl:value-of select="$titreApres"/>
	</fo:block>
</xsl:template>
</xsl:stylesheet>
