<xsl:stylesheet xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.0">
    <xsl:template name="displayXMLMarkName">
        <xsl:param name="aliasNamespace"/>
        <xsl:param name="elementName"/>
        <xsl:param name="noteContent"/>
        <text:p text:style-name="{$xmlMarkupTextStyleName}">
            <text:tab/>
            <text:span text:style-name="{$boldUnderlineTextStyleName}">Nom de balise XML</text:span> : <text:span text:style-name="{$xmlMarkupTitleStyleName}">
                <xsl:value-of select="concat('&lt;', $aliasNamespace , ':', $elementName, '&gt;')"/>
            </text:span>
            <xsl:call-template name="displayNote">
                <xsl:with-param name="noteContent" select="$noteContent"/>
            </xsl:call-template>
        </text:p>
    </xsl:template>
    <xsl:template name="displayCode">
        <xsl:param name="text"/>
        <text:p text:style-name="{$codeTextStyleName}">
            <text:tab/>
            <text:span text:style-name="{$boldUnderlineTextStyleName}">Code</text:span> : <text:span text:style-name="{$codeTitleStyleName}">
                <xsl:value-of select="$text"/>
            </text:span>
        </text:p>
    </xsl:template>
    <xsl:template name="displayCodeOfEntity">
        <xsl:param name="text"/>
        <text:list-item>
            <xsl:call-template name="displayCode">
                <xsl:with-param name="text" select="$text"/>
            </xsl:call-template>
        </text:list-item>
    </xsl:template>
    <xsl:template name="displayXMLMarkNameOfEntity">
        <xsl:param name="aliasNamespace"/>
        <xsl:param name="elementName"/>
        <xsl:param name="noteContent"/>
        <text:list-item>
            <xsl:call-template name="displayXMLMarkName">
                <xsl:with-param name="aliasNamespace" select="$aliasNamespace"/>
                <xsl:with-param name="elementName" select="$elementName"/>
                <xsl:with-param name="noteContent" select="$noteContent"/>
            </xsl:call-template>
        </text:list-item>
    </xsl:template>
    <xsl:template name="displayDefinition">
		<!--xsl:param name="text"/-->
        <xsl:param name="noteContent"/>
        <text:list-item>
            <text:p text:style-name="{$definitionTitleStyleName}">
                <text:tab/>
                <text:span text:style-name="{$boldUnderlineTextStyleName}">Définition </text:span> :
		</text:p>
        </text:list-item>
		<!--xsl:call-template name="formatDefinition"><xsl:with-param name="text" select="$text"/></xsl:call-template-->
        <xsl:call-template name="displayNote">
            <xsl:with-param name="noteContent" select="$noteContent"/>
        </xsl:call-template>
		<!--/text:p-->
    </xsl:template>

	<!-- 
		REMPLACE LES RETOURS A LA LIGNE D'UN TEXTE PAR DES <BR/>
	-->
    <xsl:template name="formatDefinition">
        <xsl:param name="text"/>
        <xsl:choose>
            <xsl:when test="contains($text, '&#xA;')">
                <text:p text:style-name="{$definitionTextStyleName}">
                    <xsl:value-of select="substring-before($text, '&#xA;')"/>
                </text:p>
                <xsl:call-template name="formatDefinition">
                    <xsl:with-param name="text" select="substring-after($text, '&#xA;')"/>
                </xsl:call-template>
            </xsl:when>
            <xsl:otherwise>
                <text:p text:style-name="{$definitionTextStyleName}">
                    <xsl:value-of select="$text"/>
                </text:p>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>
    <xsl:template name="displayInfoOfEntityTitle">
        <text:p/>
        <text:list text:style-name="WW8Num24">
            <text:list-item text:start-value="1">
                <text:p text:style-name="{$infoOfEntityTitleStyleName}">
                    <text:span text:style-name="{$boldUnderlineTextStyleName}">Liste des attributs (avec les cardinalités) :</text:span>
                </text:p>
            </text:list-item>
        </text:list>
    </xsl:template>
    <xsl:template name="displayEntityChildTitle">
        <text:p/>
        <text:list text:style-name="WW8Num24">
            <text:list-item text:start-value="1">
                <text:p text:style-name="{$entityChildTitleStyleName}">
                    <text:span text:style-name="{$boldUnderlineTextStyleName}">Cette entité est héritée par :</text:span>
                </text:p>
            </text:list-item>
        </text:list>
    </xsl:template>
    <xsl:template name="displayEntityParentTitle">
        <text:p/>
        <text:list text:style-name="WW8Num24">
            <text:list-item text:start-value="1">
                <text:p text:style-name="{$entityParentTitleStyleName}">
                    <text:span text:style-name="{$boldUnderlineTextStyleName}">Cette entité hérite de :</text:span>
                </text:p>
            </text:list-item>
        </text:list>
    </xsl:template>
    <xsl:template name="displayAttribute11OfEntity">
        <xsl:param name="text"/>
        <xsl:param name="mode"/>
        <xsl:param name="relativeUrl"/>
        <xsl:param name="noteContent"/>
        <xsl:param name="attributName"/>
        <xsl:param name="ref"/>
        <xsl:choose>
            <xsl:when test="$noteContent">
                <text:p text:style-name="{$attribute11OfEntityStyleName}">
                    <text:tab/>
                    <xsl:value-of select="$text"/>
                    <xsl:call-template name="displayNote">
                        <xsl:with-param name="noteContent" select="$noteContent"/>
                    </xsl:call-template>
                </text:p>
            </xsl:when>
            <xsl:otherwise>
                <xsl:choose>
                    <xsl:when test=" $mode != 'extern' ">
                        <text:list-item>
                            <text:p text:style-name="{$attribute11OfEntityStyleName}">
                                <text:tab/>
                                <text:reference-ref text:reference-format="text" text:ref-name="{$ref}">
                                    <xsl:value-of select="normalize-space($text)"/>
                                </text:reference-ref>
                                <text:span text:style-name="Standard"> (1,1)</text:span>
                            </text:p>
							<!--text:p text:style-name="{$attribute11OfEntityStyleName}"><text:tab/><xsl:value-of select="$text"/><text:span text:style-name="Standard"> (1,1)</text:span> [<text:reference-ref text:reference-format="chapter" text:ref-name="{$ref}"/>]</text:p-->
                        </text:list-item>
                    </xsl:when>
                    <xsl:otherwise>
                        <text:list-item>
                            <text:p text:style-name="{$attribute11OfEntityStyleName}">
                                <text:tab/>
                                <text:a xlink:type="simple" xlink:href="{$relativeUrl}">
                                    <xsl:value-of select="normalize-space($text)"/>
                                </text:a>
                                <text:span text:style-name="Standard"> (1,1)</text:span>
                            </text:p>
                        </text:list-item>
                    </xsl:otherwise>
                </xsl:choose>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>
    <xsl:template name="displayAttribute01OfEntity">
        <xsl:param name="text"/>
        <xsl:param name="mode"/>
        <xsl:param name="relativeUrl"/>
        <xsl:param name="noteContent"/>
        <xsl:param name="attributName"/>
        <xsl:param name="ref"/>
        <xsl:choose>
            <xsl:when test="$noteContent">
                <text:p text:style-name="{$attribute01OfEntityStyleName}">
                    <text:tab/>
                    <xsl:value-of select="$text"/>
                    <xsl:call-template name="displayNote">
                        <xsl:with-param name="noteContent" select="$noteContent"/>
                    </xsl:call-template>
                </text:p>
            </xsl:when>
            <xsl:otherwise>
                <xsl:choose>
                    <xsl:when test=" $mode != 'extern' ">
                        <text:list-item>
                            <text:p text:style-name="{$attribute01OfEntityStyleName}">
                                <text:tab/>
                                <text:reference-ref text:reference-format="text" text:ref-name="{$ref}">
                                    <xsl:value-of select="normalize-space($text)"/>
                                </text:reference-ref>
                                <text:span text:style-name="Standard"> (0,1)</text:span>
                            </text:p>
							<!--text:p text:style-name="{$attribute01OfEntityStyleName}"><text:tab/><xsl:value-of select="$text"/><text:span text:style-name="Standard"> (0,1)</text:span> [<text:reference-ref text:reference-format="chapter" text:ref-name="{$ref}"/>]</text:p-->
                        </text:list-item>
                    </xsl:when>
                    <xsl:otherwise>
                        <text:list-item>
                            <text:p text:style-name="{$attribute01OfEntityStyleName}">
                                <text:tab/>
                                <text:a xlink:type="simple" xlink:href="{$relativeUrl}">
                                    <xsl:value-of select="normalize-space($text)"/>
                                </text:a>
                                <text:span text:style-name="Standard"> (0,1)</text:span>
                            </text:p>
                        </text:list-item>
                    </xsl:otherwise>
                </xsl:choose>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>
    <xsl:template name="displayAssoOfEntityTitle">
        <text:p/>
        <text:list text:style-name="WW8Num24">
            <text:list-item text:start-value="1">
                <text:p text:style-name="{$assoOfEntityTitleStyleName}">
                    <text:span text:style-name="{$boldUnderlineTextStyleName}">Liste des associations (avec les cardinalités) :</text:span>
                </text:p>
            </text:list-item>
        </text:list>
    </xsl:template>
    <xsl:template name="displayAttribute0nOfEntity">
        <xsl:param name="text"/>
        <xsl:param name="mode"/>
        <xsl:param name="relativeUrl"/>
        <xsl:param name="noteContent"/>
        <xsl:param name="attributName"/>
        <xsl:param name="ref"/>
        <xsl:choose>
            <xsl:when test="$noteContent">
                <text:p text:style-name="{$attribute0nOfEntityStyleName}">
                    <text:tab/>
                    <xsl:value-of select="$text"/>
                    <xsl:call-template name="displayNote">
                        <xsl:with-param name="noteContent" select="$noteContent"/>
                    </xsl:call-template>
                </text:p>
            </xsl:when>
            <xsl:otherwise>
                <xsl:choose>
                    <xsl:when test=" $mode != 'extern' ">
                        <text:list-item>													
							<!--text:p text:style-name="{$attribute0nOfEntityStyleName}"><text:tab/><text:reference-ref text:reference-format="text" text:ref-name="{$ref}"><xsl:value-of select="normalize-space($text)"/></text:reference-ref><text:span text:style-name="Standard"> (0,n)</text:span-->
                            <text:p text:style-name="{$attribute0nOfEntityStyleName}">
                                <text:tab/>
                                <xsl:value-of select="$text"/>
                                <text:span text:style-name="Standard"> (0,n)</text:span> [<text:reference-ref text:reference-format="chapter" text:ref-name="{$ref}"/>]
								<xsl:call-template name="displayNote">
                                    <xsl:with-param name="noteContent" select="$noteContent"/>
                                </xsl:call-template>
                            </text:p>
                        </text:list-item>
                    </xsl:when>
                    <xsl:otherwise>
                        <text:list-item>
                            <text:p text:style-name="{$attribute0nOfEntityStyleName}">
                                <text:tab/>
                                <text:a xlink:type="simple" xlink:href="{$relativeUrl}">
                                    <xsl:value-of select="normalize-space($text)"/>
                                </text:a>
                                <text:span text:style-name="Standard"> (0,n)</text:span>
                                <xsl:call-template name="displayNote">
                                    <xsl:with-param name="noteContent" select="$noteContent"/>
                                </xsl:call-template>
                            </text:p>
                        </text:list-item>
                    </xsl:otherwise>
                </xsl:choose>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>
    <xsl:template name="displayChapterTitleOfEntity">
        <xsl:param name="text"/>
        <xsl:param name="noteContent"/>
        <xsl:param name="ref"/>
        <xsl:call-template name="displayChapterTitle">
            <xsl:with-param name="text" select="$text"/>
            <xsl:with-param name="noteContent" select="$noteContent"/>
            <xsl:with-param name="ref" select="$ref"/>
        </xsl:call-template>
    </xsl:template>
    <xsl:template name="displayChapterTitleOfAttribute">
        <xsl:param name="text"/>
        <xsl:param name="noteContent"/>
        <xsl:param name="ref"/>
        <xsl:call-template name="displayChapterTitle">
            <xsl:with-param name="text" select="$text"/>
            <xsl:with-param name="noteContent" select="$noteContent"/>
            <xsl:with-param name="ref" select="$ref"/>
        </xsl:call-template>
    </xsl:template>
    <xsl:template name="displayXMLMarkNameOfAttribute">
        <xsl:param name="aliasNamespace"/>
        <xsl:param name="elementName"/>
        <xsl:param name="noteContent"/>
        <text:list-item>
            <xsl:call-template name="displayXMLMarkName">
                <xsl:with-param name="aliasNamespace" select="$aliasNamespace"/>
                <xsl:with-param name="elementName" select="$elementName"/>
                <xsl:with-param name="noteContent" select="$noteContent"/>
            </xsl:call-template>
        </text:list-item>
    </xsl:template>
    <xsl:template name="displayCodeOfAttribute">
        <xsl:param name="text"/>
        <text:list-item>
            <xsl:call-template name="displayCode">
                <xsl:with-param name="text" select="$text"/>
            </xsl:call-template>
        </text:list-item>
    </xsl:template>
    <xsl:template name="displayCaracteristicsLabel">
        <text:p text:style-name="{$caracteristicsTitleStyleName}">
            <text:tab/>
            <text:span text:style-name="{$boldUnderlineTextStyleName}">Caractéristiques :</text:span>
        </text:p>
    </xsl:template>
    <xsl:template name="displayOneSingleValueCaracteristicOfAttribute">
        <xsl:param name="caracteristicValue"/>
        <xsl:param name="caracteristicLabel"/>
        <xsl:if test="string($caracteristicValue) != '' ">
            <text:list-item>
                <text:p text:style-name="{$caracteristicValueStyleName}">
                    <text:tab/>
                    <text:span text:style-name="{$boldUnderlineTextStyleName}">
                        <xsl:value-of select="$caracteristicLabel"/>
                    </text:span> : <text:span text:style-name="{$caracteristicNameStyleName}">
                        <xsl:value-of select="$caracteristicValue"/>
                    </text:span>
                </text:p>
            </text:list-item>
        </xsl:if>
    </xsl:template>
    <xsl:template name="displayMultiValueCaracteristicOfAttribute">
        <xsl:param name="caracteristicValue"/>
        <xsl:param name="caracteristicLabel"/>
        <xsl:if test="string($caracteristicValue) != ''">
            <text:list-item>
                <text:p text:style-name="{$caracteristicValueStyleName}">
                    <text:tab/>
                    <text:span text:style-name="{$boldUnderlineTextStyleName}">
                        <xsl:value-of select="$caracteristicLabel"/>
                    </text:span> : <text:span text:style-name="{$caracteristicNameStyleName}">
                        <xsl:value-of select="$caracteristicValue[position()=1]"/>
                    </text:span>
                </text:p>
                <xsl:for-each select="$caracteristicValue[position()&gt;1]">
                    <text:p text:style-name="{$caracteristicValueStyleName}">
                        <text:tab/>
                        <text:tab/>
                        <text:span text:style-name="{$caracteristicNameStyleName}">
                            <xsl:value-of select="."/>
                        </text:span>
                    </text:p>
                </xsl:for-each>
            </text:list-item>
        </xsl:if>
    </xsl:template>

	<!--xsl:template name="displayTextInAttributeCaracteristics">
		<xsl:param name="text"/>
		<text:p text:style-name="{$caracteristicValueStyleName}"><text:tab/><text:span text:style-name="{$boldTextStyleName}"><xsl:value-of select="$text"/></text:span>
		</text:p>		
	</xsl:template-->
    <xsl:template name="displayOneLinkObjectNameOfAttribute">
        <xsl:param name="objectName"/>
        <xsl:param name="objectLabel"/>
        <xsl:param name="noteContent"/>
        <xsl:choose>
            <xsl:when test="$noteContent">
                <text:span text:style-name="{$linkObjectNameOfAttributeStyleName}">
                    <xsl:value-of select="$objectLabel"/>
                    <xsl:call-template name="displayNote">
                        <xsl:with-param name="noteContent" select="$noteContent"/>
                    </xsl:call-template>
                </text:span>
            </xsl:when>
            <xsl:otherwise>
                <text:span text:style-name="{$linkObjectNameOfAttributeStyleName}">
                    <text:reference-ref text:reference-format="text" text:ref-name="{$objectName}">
                        <xsl:value-of select="normalize-space($objectLabel)"/>
                    </text:reference-ref>
                </text:span>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>
    <xsl:template name="displayOneLineOfCodeTypeDefinitionList">
        <xsl:param name="definitionLabel"/>
        <xsl:param name="definitionValue"/>
        <text:p/>
        <text:p text:style-name="{$codeTypeDefinitionLabelStyleName}">
            <xsl:value-of select="$definitionLabel"/>	:</text:p>
        <text:p text:style-name="{$codeTypeDefinitionValueStyleName}">
            <xsl:value-of select="$definitionValue"/>
        </text:p>
    </xsl:template>
    <xsl:template name="displayFormat">
        <xsl:param name="format"/>
        <text:list-item>
            <text:p text:style-name="{$caracteristicValueStyleName}">
                <text:tab/>
                <text:span text:style-name="{$boldUnderlineTextStyleName}">Type de données</text:span> : <text:span text:style-name="{$caracteristicNameStyleName}">
                    <xsl:value-of select="$format"/>
                </text:span>
            </text:p>
        </text:list-item>
    </xsl:template>
    <xsl:template name="displayDateFormat">
        <xsl:call-template name="displayFormat">
            <xsl:with-param name="format" select="$dateFormat"/>
        </xsl:call-template>
    </xsl:template>
    <xsl:template name="displayTimeFormat">
        <xsl:call-template name="displayFormat">
            <xsl:with-param name="format" select="$timeFormat"/>
        </xsl:call-template>
    </xsl:template>
    <xsl:template name="displayDateTimeFormat">
        <xsl:call-template name="displayFormat">
            <xsl:with-param name="format" select="$dateTimeFormat"/>
        </xsl:call-template>
    </xsl:template>
    <xsl:template name="displayIndicatorFormat">
        <xsl:call-template name="displayFormat">
            <xsl:with-param name="format" select="$indicatorFormat"/>
        </xsl:call-template>
    </xsl:template>
    <xsl:template name="displayBinaryFormat">
        <xsl:call-template name="displayFormat">
            <xsl:with-param name="format" select="$binaryFormat"/>
        </xsl:call-template>
    </xsl:template>
    <xsl:template name="displayNumericFormat">
        <xsl:call-template name="displayFormat">
            <xsl:with-param name="format" select="$numericFormat"/>
        </xsl:call-template>
    </xsl:template>
    <xsl:template name="displayTexteOrCharacterFormat">
        <xsl:param name="isLengthDefined"/>
        <xsl:choose>
            <xsl:when test="boolean($isLengthDefined) = true()">
                <xsl:call-template name="displayFormat">
                    <xsl:with-param name="format" select="$texteFormat"/>
                </xsl:call-template>
            </xsl:when>
            <xsl:otherwise>
                <xsl:call-template name="displayFormat">
                    <xsl:with-param name="format" select="$charactersFormat"/>
                </xsl:call-template>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>
    <xsl:template name="displayEntityInfoOfEntity">
        <xsl:param name="entityName"/>
        <xsl:param name="entityLabel"/>
        <xsl:param name="minOccurs"/>
        <xsl:param name="maxOccurs"/>
        <xsl:param name="mode"/>
        <xsl:param name="ref"/>
        <xsl:param name="noteContent"/>
        <xsl:choose>
            <xsl:when test="$noteContent">
                <text:p text:style-name="{$entityInfoOfEntityStyleName}">
                    <text:tab/>
                    <xsl:value-of select="$entityName"/>
                    <xsl:call-template name="displayNote">
                        <xsl:with-param name="noteContent" select="$noteContent"/>
                    </xsl:call-template>
                </text:p>
            </xsl:when>
            <xsl:otherwise>
                <text:list-item>
                    <text:p text:style-name="{$entityInfoOfEntityStyleName}">
                        <text:tab/>
					<!--text:reference-ref text:reference-format="text" text:ref-name="{$ref}"><xsl:value-of select="normalize-space($entityLabel)"/></text:reference-ref-->
                        <xsl:value-of select="$entityLabel"/>
                        <text:span text:style-name="Standard"> (<xsl:choose>
                                <xsl:when test="string($minOccurs) = '' ">
                                    <xsl:text>1</xsl:text>
                                </xsl:when>
                                <xsl:otherwise>
                                    <xsl:value-of select="$minOccurs"/>
                                </xsl:otherwise>
                            </xsl:choose>,<xsl:choose>
                                <xsl:when test="string($maxOccurs) = '' ">
                                    <xsl:text>1</xsl:text>
                                </xsl:when>
                                <xsl:otherwise>
                                    <xsl:choose>
                                        <xsl:when test="string($maxOccurs) = 'unbounded' ">
                                            <xsl:text>n</xsl:text>
                                        </xsl:when>
                                        <xsl:otherwise>
                                            <xsl:value-of select="$maxOccurs"/>
                                        </xsl:otherwise>
                                    </xsl:choose>
                                </xsl:otherwise>
                            </xsl:choose>) </text:span> [<text:reference-ref text:reference-format="chapter" text:ref-name="{$ref}"/>]
				</text:p>
                </text:list-item>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>
    <xsl:template name="displayEntityChildInfoOfEntity">
        <xsl:param name="entityName"/>
        <xsl:param name="entityLabel"/>
        <xsl:param name="mode"/>
        <xsl:param name="relativeUrl"/>
        <xsl:param name="noteContent"/>
        <xsl:param name="ref"/>
        <xsl:choose>
            <xsl:when test="$noteContent">
                <text:p text:style-name="{$entityInfoOfEntityStyleName}">
                    <text:tab/>
                    <xsl:value-of select="$entityName"/>
                    <xsl:call-template name="displayNote">
                        <xsl:with-param name="noteContent" select="$noteContent"/>
                    </xsl:call-template>
                </text:p>
            </xsl:when>
            <xsl:otherwise>
                <text:list-item>
                    <text:p text:style-name="{$entityInfoOfEntityStyleName}">
                        <text:tab/>
                        <xsl:choose>
                            <xsl:when test=" $mode != 'extern' ">
                                <text:reference-ref text:reference-format="text" text:ref-name="{$ref}">
                                    <xsl:value-of select="normalize-space($entityLabel)"/>
                                </text:reference-ref>
                            </xsl:when>
                            <xsl:otherwise>
                                <text:a xlink:type="simple" xlink:href="{$relativeUrl}">
                                    <xsl:value-of select="normalize-space($entityName)"/>
                                </text:a>
                            </xsl:otherwise>
                        </xsl:choose>
                    </text:p>
                </text:list-item>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>
    <xsl:template name="displayLinkObjectNameOfAttribute">
        <xsl:param name="objects"/>
        <xsl:param name="noteContent"/>
        <text:list-item>
            <text:p text:style-name="{$linkObjectNameOfAttributeTitleStyleName}">
                <text:tab/>
                <text:span text:style-name="{$boldUnderlineTextStyleName}">Nom de l'Objet/Lien</text:span> : <text:span text:style-name="{$boldTextStyleName}">
                    <xsl:choose>
                        <xsl:when test="$noteContent">
                            <xsl:call-template name="displayOneLinkObjectNameOfAttribute">
                                <xsl:with-param name="objectLabel" select="string($objects)"/>
                                <xsl:with-param name="noteContent" select="$noteContent"/>
                            </xsl:call-template>
                        </xsl:when>
                        <xsl:otherwise>
                            <xsl:call-template name="displayOneLinkObjectNameOfAttribute">
                                <xsl:with-param name="objectLabel" select="$objects[position()=1]"/>
                                <xsl:with-param name="objectName" select="$objects[position()=1]/../../@name"/>
                            </xsl:call-template>
                        </xsl:otherwise>
                    </xsl:choose>
                </text:span>
            </text:p>
            <xsl:if test="not($noteContent)">
                <xsl:for-each select="$objects[position()&gt;1]">
                    <text:p>
                        <text:tab/>
                        <text:tab/>
                        <text:tab/>
                        <text:tab/>
                        <xsl:call-template name="displayOneLinkObjectNameOfAttribute">
                            <xsl:with-param name="objectLabel" select="."/>
                            <xsl:with-param name="objectName" select="../../@name"/>
                        </xsl:call-template>
                        <xsl:call-template name="displayNote">
                            <xsl:with-param name="noteContent" select="$noteContent"/>
                        </xsl:call-template>
                    </text:p>
                </xsl:for-each>
            </xsl:if>
        </text:list-item>
    </xsl:template>
    <xsl:template name="displayChapterTitle">
        <xsl:param name="text"/>
        <xsl:param name="noteContent"/>
        <xsl:param name="ref"/>
        <text:p/>
        <text:p/>
        <xsl:choose>
            <xsl:when test="$noteContent">
                <text:p text:style-name="{$chapterTitleStyleName}">
                    <xsl:value-of select="$text"/>
                    <xsl:call-template name="displayNote">
                        <xsl:with-param name="noteContent" select="$noteContent"/>
                    </xsl:call-template>
                </text:p>
            </xsl:when>
            <xsl:otherwise>
                <text:p text:style-name="{$chapterTitleStyleName}">
                    <text:reference-mark-start text:name="{$ref}"/>
                    <xsl:value-of select="$text"/>
                    <text:reference-mark-end text:name="{$ref}"/>
                </text:p>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>
    <xsl:template name="displayNote">
        <xsl:param name="noteContent"/>
        <xsl:if test="$noteContent">
            <xsl:call-template name="displayLogError">
                <xsl:with-param name="logContent" select="$noteContent"/>
            </xsl:call-template>
            <office:annotation>
                <text:p>
                    <xsl:value-of select="normalize-space($noteContent)"/>
                </text:p>
            </office:annotation>
        </xsl:if>
    </xsl:template>
    <xsl:template name="displayCodeTypeTable">
        <xsl:param name="header1"/>
        <xsl:param name="header2"/>
        <xsl:param name="header3"/>
        <xsl:param name="header4"/>
        <xsl:param name="col1"/>
        <xsl:param name="col2"/>
        <xsl:param name="col3"/>
        <xsl:param name="col4"/>
        <xsl:param name="listID"/>
        <text:p/>
        <text:list text:style-name="WW8Num24">
            <text:list-item>
                <text:p text:style-name="{$infoOfEntityTitleStyleName}">
                    <text:span text:style-name="{$boldUnderlineTextStyleName}">Liste des valeurs administrée par le Sandre est la suivante (cf nomenclature de code Sandre [ <xsl:value-of select="$listID"/> ]) :</text:span>
                </text:p>
                <text:p/>
            </text:list-item>
        </text:list>
        <table:table table:style-name="{$codeTypeTableStyleName}">
            <table:table-column table:style-name="{$codeTypeTableColumnStyleName}.A"/>
            <table:table-column table:style-name="{$codeTypeTableColumnStyleName}.B"/>
            <table:table-column table:style-name="{$codeTypeTableColumnStyleName}.C"/>
            <table:table-column table:style-name="{$codeTypeTableColumnStyleName}.D"/>
            <table:table-row table:style-name="{$codeTypeTableColumnStyleName}.1">
                <table:table-cell table:style-name="{$codeTypeTableHeaderCellStyleName}.A1" office:value-type="string">
                    <text:p text:style-name="{$codeTypeTableHeaderTextStyleName}">
                        <xsl:value-of select="$header1"/>
                    </text:p>
                </table:table-cell>
                <table:table-cell table:style-name="{$codeTypeTableHeaderCellStyleName}.A1" office:value-type="string">
                    <text:p text:style-name="{$codeTypeTableHeaderTextStyleName}">
                        <xsl:value-of select="$header2"/>
                    </text:p>
                </table:table-cell>
                <table:table-cell table:style-name="{$codeTypeTableHeaderCellStyleName}.A1" office:value-type="string">
                    <text:p text:style-name="{$codeTypeTableHeaderTextStyleName}">
                        <xsl:value-of select="$header3"/>
                    </text:p>
                </table:table-cell>
                <table:table-cell table:style-name="{$codeTypeTableHeaderCellStyleName}.D1" office:value-type="string">
                    <text:p text:style-name="{$codeTypeTableHeaderTextStyleName}">
                        <xsl:value-of select="$header4"/>
                    </text:p>
                </table:table-cell>
            </table:table-row>
            <xsl:for-each select="$col1">
                <table:table-row>
                    <xsl:variable name="index" select="position()"/>
                    <table:table-cell table:style-name="{$codeTypeTableCellStyleName}.A2" office:value-type="string">
                        <text:p text:style-name="{$codeTypeTableTextStyleNameFirstCol}">
                            <xsl:value-of select="$col1[$index]"/>
                        </text:p>
                    </table:table-cell>
                    <table:table-cell table:style-name="{$codeTypeTableCellStyleName}.A2" office:value-type="string">
                        <text:p text:style-name="{$codeTypeTableTextStyleNameOtherCols}">
                            <xsl:value-of select="$col2[$index]"/>
                        </text:p>
                    </table:table-cell>
                    <table:table-cell table:style-name="{$codeTypeTableCellStyleName}.A2" office:value-type="string">
                        <text:p text:style-name="{$codeTypeTableTextStyleNameOtherCols}">
                            <xsl:value-of select="$col3[$index]"/>
                        </text:p>
                    </table:table-cell>
                    <table:table-cell table:style-name="{$codeTypeTableCellStyleName}.D2" office:value-type="string">
                        <text:p text:style-name="{$codeTypeTableTextStyleNameOtherCols}">
                            <xsl:value-of select="$col4[$index]"/>
                        </text:p>
                    </table:table-cell>
                </table:table-row>
            </xsl:for-each>
        </table:table>
    </xsl:template>
    <xsl:template name="insertHorizontalRule">
        <text:p text:style-name="{$horizontalRuleStyleName}"/>
    </xsl:template>

	<!-- Tableau des CodeType (dictionnaires des données) -->
    <xsl:variable name="codeHeader">Code</xsl:variable>
    <xsl:variable name="mnemoHeader">Mnémonique</xsl:variable>
    <xsl:variable name="labelHeader">Libellé</xsl:variable>
    <xsl:variable name="definitionHeader">Définition</xsl:variable>
		<!-- Nom du style pour le tableau des CodeType d'un attribut -->
    <xsl:variable name="codeTypeTableStyleName">TableauCodeType</xsl:variable>
		<!-- Nom du style pour les colonnes du tableau des CodeType d'un attribut -->
    <xsl:variable name="codeTypeTableColumnStyleName">TableauCodeType</xsl:variable>
		<!-- Nom du style pour les cellules du header du tableau des CodeType d'un attribut -->
    <xsl:variable name="codeTypeTableHeaderCellStyleName">TableauCodeType</xsl:variable>
		<!-- Nom du style pour les header du tableau des CodeType d'un attribut -->
    <xsl:variable name="codeTypeTableHeaderTextStyleName">P65</xsl:variable>
		<!-- Nom du style pour les cellules du tableau des CodeType d'un attribut -->
    <xsl:variable name="codeTypeTableCellStyleName">TableauCodeType</xsl:variable>
		<!-- Nom du style pour le texte des cellules de la première colonne du tableau des CodeType d'un attribut -->
    <xsl:variable name="codeTypeTableTextStyleNameFirstCol">P66</xsl:variable>
		<!-- Nom du style pour le texte des cellules autres que la première colonne du tableau des CodeType d'un attribut -->
    <xsl:variable name="codeTypeTableTextStyleNameOtherCols">P67</xsl:variable>

	<!--
			Nom des styles dans ODF pour les dictionnaires des données
	-->
		<!-- Nom du style pour le titre du chapitre (entité & attribut) -->
    <xsl:variable name="chapterTitleStyleName">Heading 2</xsl:variable>
		<!-- Nom du style pour le titre du "Nom de balise XML" (entité & attribut) -->
    <xsl:variable name="xmlMarkupTitleStyleName">T26</xsl:variable>
		<!-- Nom du style pour la valeur du "Nom de balise XML" (entité & attribut) -->
    <xsl:variable name="xmlMarkupTextStyleName">puce</xsl:variable>
		<!-- Nom du style pour le titre du "Code" (entité & attribut) -->
    <xsl:variable name="codeTitleStyleName">T26</xsl:variable>
		<!-- Nom du style pour la valeur du "Code" (entité & attribut) -->
    <xsl:variable name="codeTextStyleName">puce</xsl:variable>
		<!-- Nom du style pour le titre de la "Définition" (entité & attribut) -->
    <xsl:variable name="definitionTitleStyleName">puce</xsl:variable>
		<!-- Nom du style pour  la valeur de la "Définition" (entité & attribut) -->
    <xsl:variable name="definitionTextStyleName">Standard</xsl:variable>
		<!-- Nom du style pour le titre des informations d'une entité -->
    <xsl:variable name="infoOfEntityTitleStyleName">puce</xsl:variable>
		<!-- Nom du style pour les entités fille d'une entité -->
    <xsl:variable name="entityChildTitleStyleName">puce</xsl:variable>
		<!-- Nom du style pour un attribut (1,1) d'une entité -->
    <xsl:variable name="attribute11OfEntityStyleName">puce2</xsl:variable>
		<!-- Nom du style pour un attribut (0,1) d'une entité -->
    <xsl:variable name="attribute01OfEntityStyleName">puce2</xsl:variable>
		<!-- Nom du style pour le titre des associations d'une entité  -->
    <xsl:variable name="assoOfEntityTitleStyleName">puce</xsl:variable>
		<!-- Nom du style pour un attribut (0,n) d'une entité  -->
    <xsl:variable name="attribute0nOfEntityStyleName">puce2</xsl:variable>
		<!-- Nom du style pour une entité fille d'une entité -->
    <xsl:variable name="entityInfoOfEntityStyleName">puce2</xsl:variable>
		<!-- Nom du style pour une entité héritée d'une entité -->
    <xsl:variable name="entityParentTitleStyleName">puce</xsl:variable>		
		<!-- Nom du style pour le titre "Nom de l'Objet/Lien" (attribut & entité) -->
    <xsl:variable name="linkObjectNameOfAttributeTitleStyleName">puce</xsl:variable>
		<!-- Nom du style pour la valeur du "Nom de l'Objet/Lien" (attribut & entité) -->
    <xsl:variable name="linkObjectNameOfAttributeStyleName">T26</xsl:variable>
		<!-- Nom du style pour le titre d'une caractéristique d'un attribut -->
    <xsl:variable name="caracteristicNameStyleName">T26</xsl:variable>
		<!-- Nom du style pour la valeur d'une caractéristique d'un attribut -->
    <xsl:variable name="caracteristicValueStyleName">puce</xsl:variable>
		<!-- Nom du style pour le titre d'un item de la définition du CodeType d'un attribut -->
    <xsl:variable name="codeTypeDefinitionLabelStyleName">Standard</xsl:variable>
		<!-- Nom du style pour la valeur d'un item de la définition du CodeType d'un attribut -->
    <xsl:variable name="codeTypeDefinitionValueStyleName">Standard</xsl:variable>
		<!-- Nom du style pour le titre du format d'un attribut -->
    <xsl:variable name="formatTitleStyleName">T26</xsl:variable>
		<!-- Nom du style pour la valeur du format d'un attribut -->
    <xsl:variable name="formatValueStyleName">puce</xsl:variable>
		<!-- Nom du style pour le titre "Caractéristiques" d'un attribut -->
    <xsl:variable name="caracteristicsTitleStyleName">puce</xsl:variable>
		<!-- Nom du style pour le paragraphe entourant une image du schéma conceptuel des données -->
    <xsl:variable name="imageParagraphStyleName">Standard</xsl:variable>
		<!-- Nom du style pour une image du schéma conceptuel des données -->
    <xsl:variable name="imageStyleName">Standard</xsl:variable>
		<!-- Nom du style de texte pour mettre en gras -->
    <xsl:variable name="boldTextStyleName">T18</xsl:variable>
		<!-- Nom du style de texte pour afficher une lihne horizontale -->
    <xsl:variable name="horizontalRuleStyleName">Horizontal_20_Line</xsl:variable>
		<!-- Nom du style de texte pour mettre en gras souligné -->
    <xsl:variable name="boldUnderlineTextStyleName">T15</xsl:variable>
</xsl:stylesheet>