1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211
|
<?xml version='1.0' encoding='ISO-8859-1'?>
<!--
2 choses faire la main aprs utilisation :
* ajouter la langue pour l'lment STRINGS
* ajouter les titres dans les diffrentes langues partir des fichiers .properties s'ils taient utiliss
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" indent="yes" encoding="ISO-8859-1"/>
<xsl:template match="JAXECFG">
<CONFIG_JAXE>
<xsl:call-template name="LANGAGE"/>
<xsl:call-template name="ENREGISTREMENT"/>
<xsl:call-template name="MENUS"/>
<xsl:call-template name="AFFICHAGE_NOEUDS"/>
<xsl:call-template name="EXPORTS"/>
<xsl:call-template name="STRINGS"/>
</CONFIG_JAXE>
</xsl:template>
<xsl:template name="LANGAGE">
<LANGAGE>
<xsl:choose>
<xsl:when test="FICHIERSCHEMA">
<FICHIER_SCHEMA nom="{FICHIERSCHEMA/@nom}"/>
</xsl:when>
<xsl:otherwise>
<SCHEMA_SIMPLE>
<xsl:for-each select="RACINE/BALISE[count(../../MENU//BALISE[@nom=current()/@nom])=0] | MENU//BALISE">
<xsl:variable name="texte"><xsl:choose>
<xsl:when test="count(TEXTE) > 0">autorise</xsl:when>
<xsl:when test="count(//ENSEMBLE[@nom=current()/SOUSBALISE/@ensemble]/TEXTE) > 0">autorise</xsl:when>
<xsl:otherwise>interdit</xsl:otherwise>
</xsl:choose></xsl:variable>
<ELEMENT nom="{@nom}" texte="{$texte}">
<xsl:for-each select="SOUSBALISE">
<xsl:choose>
<xsl:when test="@nom!=''">
<SOUS-ELEMENT element="{@nom}"/>
</xsl:when>
<xsl:when test="@ensemble!=''">
<SOUS-ENSEMBLE ensemble="{@ensemble}"/>
</xsl:when>
</xsl:choose>
</xsl:for-each>
<xsl:for-each select="ATTRIBUT">
<ATTRIBUT nom="{@nom}" presence="{@presence}">
<xsl:copy-of select="VALEUR"/>
</ATTRIBUT>
</xsl:for-each>
</ELEMENT>
</xsl:for-each>
<xsl:for-each select="ENSEMBLE">
<ENSEMBLE nom="{@nom}">
<xsl:for-each select="SOUSBALISE">
<xsl:choose>
<xsl:when test="@nom!=''">
<SOUS-ELEMENT element="{@nom}"/>
</xsl:when>
<xsl:when test="@ensemble!=''">
<SOUS-ENSEMBLE ensemble="{@ensemble}"/>
</xsl:when>
</xsl:choose>
</xsl:for-each>
</ENSEMBLE>
</xsl:for-each>
</SCHEMA_SIMPLE>
</xsl:otherwise>
</xsl:choose>
<xsl:for-each select="RACINE">
<RACINE element="{BALISE[1]/@nom}"/>
</xsl:for-each>
<xsl:for-each select="CONFIG">
<AUTRE_CONFIG nom="{@nom}"/>
</xsl:for-each>
</LANGAGE><xsl:text>
</xsl:text>
</xsl:template>
<xsl:template name="ENREGISTREMENT">
<xsl:if test="ENCODAGE | DOCTYPE | ESPACE">
<ENREGISTREMENT>
<xsl:if test="ENCODAGE">
<xsl:copy-of select="ENCODAGE"/>
</xsl:if>
<xsl:if test="DOCTYPE">
<xsl:copy-of select="DOCTYPE"/>
</xsl:if>
<xsl:if test="ESPACE and ESPACE[1]/@prefixe!=''">
<PREFIXE_ESPACE prefixe="{ESPACE[1]/@prefixe}" uri="{ESPACE[1]/@uri}"/>
</xsl:if>
</ENREGISTREMENT><xsl:text>
</xsl:text>
</xsl:if>
</xsl:template>
<xsl:template name="MENUS">
<MENUS>
<xsl:apply-templates select="MENU"/>
</MENUS><xsl:text>
</xsl:text>
</xsl:template>
<xsl:template match="MENU">
<MENU nom="{@titre}">
<xsl:for-each select="MENU|BALISE|FONCTION|SEPARATEUR">
<xsl:choose>
<xsl:when test="self::MENU">
<xsl:apply-templates select="."/>
</xsl:when>
<xsl:when test="self::BALISE and (not(@cache) or @cache='false')">
<xsl:variable name="type_noeud"><xsl:choose>
<xsl:when test="@noeudtype='instruction'">instruction</xsl:when>
<xsl:otherwise>element</xsl:otherwise>
</xsl:choose></xsl:variable>
<MENU_INSERTION nom="{@nom}" type_noeud="{$type_noeud}">
<xsl:if test="@commande">
<xsl:attribute name="raccourci"><xsl:value-of select="@commande"/></xsl:attribute>
</xsl:if>
</MENU_INSERTION>
</xsl:when>
<xsl:when test="self::FONCTION">
<MENU_FONCTION nom="{@titre}" classe="{@classe}">
<xsl:if test="@commande">
<xsl:attribute name="raccourci"><xsl:value-of select="@commande"/></xsl:attribute>
</xsl:if>
<xsl:copy-of select="PARAMETRE"/>
</MENU_FONCTION>
</xsl:when>
<xsl:when test="self::SEPARATEUR">
<SEPARATEUR/>
</xsl:when>
</xsl:choose>
</xsl:for-each>
</MENU>
</xsl:template>
<xsl:template name="AFFICHAGE_NOEUDS">
<AFFICHAGE_NOEUDS>
<xsl:for-each select="RACINE/BALISE[count(../../MENU//BALISE[@nom=current()/@nom])=0] | MENU//BALISE">
<xsl:choose>
<xsl:when test="@noeudtype='instruction' and @type='plugin'">
<PLUGIN_INSTRUCTION cible="{@nom}">
<xsl:copy-of select="PARAMETRE"/>
</PLUGIN_INSTRUCTION>
</xsl:when>
<xsl:otherwise>
<AFFICHAGE_ELEMENT element="{@nom}" type="{@type}">
<xsl:copy-of select="PARAMETRE"/>
</AFFICHAGE_ELEMENT>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</AFFICHAGE_NOEUDS><xsl:text>
</xsl:text>
</xsl:template>
<xsl:template name="EXPORTS">
<xsl:if test="FICHIERXSL">
<EXPORTS>
<EXPORT nom="HTML" sortie="HTML">
<xsl:for-each select="FICHIERXSL">
<FICHIER_XSL nom="{@nom}">
<xsl:copy-of select="PARAMETRE"/>
</FICHIER_XSL>
</xsl:for-each>
</EXPORT>
</EXPORTS><xsl:text>
</xsl:text>
</xsl:if>
</xsl:template>
<xsl:template name="STRINGS">
<STRINGS> <!-- pb : attribut langue ? -->
<DESCRIPTION_CONFIG><xsl:value-of select="DESCRIPTION"/></DESCRIPTION_CONFIG>
<xsl:choose>
<xsl:when test="OPTIONS/@titres='titres'">
<xsl:for-each select="RACINE/BALISE[count(../../MENU//BALISE[@nom=current()/@nom])=0] | MENU//BALISE">
<xsl:if test="@titre!='' and not(@noeudtype='instruction')">
<STRINGS_ELEMENT element="{@nom}">
<TITRE><xsl:value-of select="@titre"/></TITRE>
</STRINGS_ELEMENT>
</xsl:if>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="RACINE/BALISE[count(../../MENU//BALISE[@nom=current()/@nom])=0] | MENU//BALISE">
<xsl:if test="@titre!='' and not(@noeudtype='instruction')">
<STRINGS_MENU menu="{@nom}">
<TITRE><xsl:value-of select="@titre"/></TITRE>
</STRINGS_MENU>
</xsl:if>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
</STRINGS>
</xsl:template>
</xsl:stylesheet>
|