Diff for /modules/damieng/schema_documentation/XMLSchema.xsl between versions 1.1 and 1.2

version 1.1, 2017/01/05 19:37:43 version 1.2, 2017/01/18 18:46:10
Line 8 Line 8
   <xsl:output method="html" indent="yes"    <xsl:output method="html" indent="yes"
               doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"/>                doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"/>
   
       <xsl:param name="titre"/>
     <xsl:param name="jaxe-uri-xsl"/>      <xsl:param name="jaxe-uri-xsl"/>
     <xsl:variable name="uri-xsl"><xsl:call-template name="rep-uri"><xsl:with-param name="chemin" select="$jaxe-uri-xsl"/></xsl:call-template></xsl:variable>      <xsl:variable name="uri-xsl"><xsl:call-template name="rep-uri"><xsl:with-param name="chemin" select="$jaxe-uri-xsl"/></xsl:call-template></xsl:variable>
     <xsl:variable name="langue"><xsl:choose>      <xsl:variable name="langue">
         <xsl:when test="/xs:schema/@xml:lang"><xsl:value-of select="translate(/xs:schema/@xml:lang, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')"/></xsl:when>        <xsl:choose>
         <xsl:otherwise>fr</xsl:otherwise>            <xsl:when test="/xs:schema/@xml:lang"><xsl:value-of select="translate(/xs:schema/@xml:lang, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')"/></xsl:when>
     </xsl:choose></xsl:variable>            <xsl:otherwise>fr</xsl:otherwise>
         </xsl:choose>
       </xsl:variable>
     <xsl:variable name="messages" select="document(concat($uri-xsl, '/XMLSchema_messages_', $langue, '.xml'))/messages"/>      <xsl:variable name="messages" select="document(concat($uri-xsl, '/XMLSchema_messages_', $langue, '.xml'))/messages"/>
           
   <xsl:template match="xs:schema">    <xsl:template match="xs:schema">
     <html>      <html>
       <head>        <head>
         <title><xsl:value-of select="$messages/message[@label='Schéma XML']"/></title>          <title><xsl:value-of select="$titre"/></title>
         <style type="text/css">          <style type="text/css">
 body { color: #000000; background: #FFFFFF }  body { color: #000000; background: #FFFFFF }
 .documentation { font-family: monospace; color: #005500; white-space: pre-line }  .documentation { font-family: monospace; color: #005500; white-space: pre-line; margin-bottom: 1em }
 .grandlien { font-size: 120%; font-weight: bold }  .grandlien { font-size: 120%; font-weight: bold }
 .nomtitre { color: #550000 }  .nomtitre { color: #550000 }
 .nomattribut { color: #000055; font-weight: bold }  .nomattribut { color: #000055; font-weight: bold }
 .indentation { margin-left: 2em; margin-top: 1em; margin-bottom: 1em }  .indentation { margin-left: 2em; margin-top: 1em; margin-bottom: 1em }
   ul { margin-top: 0.5em }
         </style>          </style>
       </head>        </head>
       <body>        <body>
         <div align="center">          <div align="center">
         <h1><xsl:value-of select="$messages/message[@label='Schéma XML']"/></h1>          <h1><xsl:value-of select="$titre"/></h1>
         </div>          </div>
         <br/>          <br/>
         <span class="grandlien">          <span class="grandlien">
Line 48  body { color: #000000; background: #FFFF Line 52  body { color: #000000; background: #FFFF
           <xsl:variable name="total" select="count(//*[@name=current()/@name])"/>            <xsl:variable name="total" select="count(//*[@name=current()/@name])"/>
           <a href="#{@name}_{$numero}"><xsl:value-of select="@name"/></a>            <a href="#{@name}_{$numero}"><xsl:value-of select="@name"/></a>
           <xsl:if test="$total &gt; 1 and ancestor::*[@name!=''][1]">            <xsl:if test="$total &gt; 1 and ancestor::*[@name!=''][1]">
             (<xsl:value-of select="$messages/message[@label='sous']"/><xsl:text> </xsl:text><xsl:value-of select="ancestor::*[@name!=''][1]/@name"/>)              (<xsl:value-of select="$messages/message[@label='sous']"/><xsl:text> </xsl:text>
               <xsl:value-of select="ancestor::*[@name!=''][1]/@name"/>)
           </xsl:if>            </xsl:if>
           <br/>            <br/>
         </xsl:for-each>          </xsl:for-each>
Line 78  body { color: #000000; background: #FFFF Line 83  body { color: #000000; background: #FFFF
       <br/>        <br/>
     </xsl:when>      </xsl:when>
     <xsl:otherwise>      <xsl:otherwise>
       <xsl:variable name="numero"><xsl:value-of select="count(preceding::*[@name=current()/@name])"/></xsl:variable>        <xsl:variable name="numero" select="count(preceding::*[@name=current()/@name])"/>
       <a name="{@name}_{$numero}"/>        <a name="{@name}_{$numero}"/>
       <h3><xsl:value-of select="$messages/message[@label='Elément']"/><xsl:text> </xsl:text><span class="nomtitre"><xsl:value-of select="@name"/></span></h3>        <h3><xsl:value-of select="$messages/message[@label='Elément']"/><xsl:text> </xsl:text>
         <span class="nomtitre"><xsl:value-of select="@name"/></span></h3>
       <xsl:if test="@type">        <xsl:if test="@type">
         <xsl:value-of select="$messages/message[@label='type:']"/><xsl:text> </xsl:text><xsl:call-template name="nomtype"/><br/>          <xsl:value-of select="$messages/message[@label='type:']"/><xsl:text> </xsl:text>
           <xsl:call-template name="nomtype">
             <xsl:with-param name="type" select="@type"/>
           </xsl:call-template>
           <br/>
       </xsl:if>        </xsl:if>
       <xsl:apply-templates/>        <xsl:apply-templates/>
       <br/>        <br/>
       <xsl:if test="parent::xs:schema">        <xsl:if test="parent::xs:schema">
         <xsl:for-each select="//xs:element[.//xs:element[@ref=current()/@name or substring-after(@ref,':')=current()/@name]] | //xs:group[.//xs:element[@ref=current()/@name or substring-after(@ref,':')=current()/@name]]">          <xsl:for-each select="//xs:element[.//xs:element[@ref=current()/@name or substring-after(@ref,':')=current()/@name]] | //xs:group[.//xs:element[@ref=current()/@name or substring-after(@ref,':')=current()/@name]]">
           <xsl:if test="position() = 1">            <xsl:if test="position() = 1">
             <xsl:value-of select="$messages/message[@label='Parents:']"/>              <xsl:value-of select="$messages/message[@label='Parents:']"/><xsl:text> </xsl:text>
           </xsl:if>            </xsl:if>
           <xsl:if test="position() != 1">, </xsl:if>            <xsl:if test="position() != 1">, </xsl:if>
           <xsl:variable name="numero2"><xsl:value-of select="count(preceding::*[@name=current()/@name])"/></xsl:variable>            <xsl:variable name="numero2" select="count(preceding::*[@name=current()/@name])"/>
           <a href="#{@name}_{$numero2}"><xsl:value-of select="@name"/></a>             <a href="#{@name}_{$numero2}"><xsl:value-of select="@name"/></a> 
         </xsl:for-each>          </xsl:for-each>
         <br/>          <br/>
Line 128  body { color: #000000; background: #FFFF Line 138  body { color: #000000; background: #FFFF
     <xsl:otherwise>      <xsl:otherwise>
       <xsl:variable name="numero" select="count(preceding::*[@name=current()/@name])"/>        <xsl:variable name="numero" select="count(preceding::*[@name=current()/@name])"/>
       <a name="{@name}_{$numero}"/>        <a name="{@name}_{$numero}"/>
       <h3><xsl:value-of select="$messages/message[@label='Groupe']"/><xsl:text> </xsl:text><span class="nomtitre"><xsl:value-of select="@name"/></span></h3>        <h3><xsl:value-of select="$messages/message[@label='Groupe']"/><xsl:text> </xsl:text>
         <span class="nomtitre"><xsl:value-of select="@name"/></span></h3>
       <xsl:apply-templates/>        <xsl:apply-templates/>
       <br/>        <br/>
       <xsl:for-each select="//xs:element[.//xs:group[@ref=current()/@name or substring-after(@ref,':')=current()/@name]] | //xs:group[.//xs:group[@ref=current()/@name or substring-after(@ref,':')=current()/@name]]">        <xsl:for-each select="//xs:element[.//xs:group[@ref=current()/@name or substring-after(@ref,':')=current()/@name]] | //xs:group[.//xs:group[@ref=current()/@name or substring-after(@ref,':')=current()/@name]]">
         <xsl:if test="position() = 1">          <xsl:if test="position() = 1">
           <xsl:value-of select="$messages/message[@label='Parents:']"/>            <xsl:value-of select="$messages/message[@label='Parents:']"/><xsl:text> </xsl:text>
         </xsl:if>          </xsl:if>
         <xsl:if test="position() != 1">, </xsl:if>          <xsl:if test="position() != 1">, </xsl:if>
         <xsl:variable name="numero2"><xsl:value-of select="count(preceding::*[@name=current()/@name])"/></xsl:variable>          <xsl:variable name="numero2" select="count(preceding::*[@name=current()/@name])"/>
         <a href="#{@name}_{$numero2}"><xsl:value-of select="@name"/></a>           <a href="#{@name}_{$numero2}"><xsl:value-of select="@name"/></a> 
       </xsl:for-each>        </xsl:for-each>
       <br/>        <br/>
Line 146  body { color: #000000; background: #FFFF Line 157  body { color: #000000; background: #FFFF
   </xsl:template>    </xsl:template>
   
   <xsl:template match="xs:documentation">    <xsl:template match="xs:documentation">
     <div class="documentation"><xsl:value-of select="."/></div>      <div class="documentation"><xsl:choose>
     <br/>        <xsl:when test="starts-with(., '&#10;')">
           <xsl:value-of select="substring-after(., '&#10;')"/>
         </xsl:when>
         <xsl:otherwise>
           <xsl:value-of select="."/>
         </xsl:otherwise>
       </xsl:choose></div>
       <xsl:if test="parent::xs:annotation/parent::xs:schema">
         <hr/>
       </xsl:if>
   </xsl:template>    </xsl:template>
       
   <xsl:template match="xs:choice">    <xsl:template match="xs:choice">
Line 173  body { color: #000000; background: #FFFF Line 193  body { color: #000000; background: #FFFF
     <xsl:if test="@name">      <xsl:if test="@name">
       <xsl:variable name="numero" select="count(preceding::*[@name=current()/@name])"/>        <xsl:variable name="numero" select="count(preceding::*[@name=current()/@name])"/>
       <a name="{@name}_{$numero}"/>        <a name="{@name}_{$numero}"/>
       <h3><xsl:value-of select="$messages/message[@label='Type complexe']"/><xsl:text> </xsl:text><span class="nomtitre"><xsl:value-of select="@name"/></span></h3>        <h3><xsl:value-of select="$messages/message[@label='Type complexe']"/><xsl:text> </xsl:text>
         <span class="nomtitre"><xsl:value-of select="@name"/></span></h3>
     </xsl:if>      </xsl:if>
     <xsl:if test="@ref">      <xsl:if test="@ref">
       <xsl:variable name="numero" select="count(preceding::*[@name=current()/@name])"/>        <xsl:variable name="numero" select="count(preceding::*[@name=current()/@name])"/>
Line 191  body { color: #000000; background: #FFFF Line 212  body { color: #000000; background: #FFFF
   </xsl:template>    </xsl:template>
       
   <xsl:template match="xs:attribute">    <xsl:template match="xs:attribute">
     <xsl:value-of select="$messages/message[@label='Attribut']"/><xsl:text> </xsl:text><span class="nomattribut"><xsl:value-of select="@name"/></span>:      <xsl:value-of select="$messages/message[@label='Attribut']"/><xsl:text> </xsl:text>
       <span class="nomattribut"><xsl:value-of select="@name"/></span>:
     <div class="indentation">      <div class="indentation">
     <xsl:choose>      <xsl:choose>
     <xsl:when test="@use='required'">      <xsl:when test="@use='required'">
Line 202  body { color: #000000; background: #FFFF Line 224  body { color: #000000; background: #FFFF
     </xsl:otherwise>      </xsl:otherwise>
     </xsl:choose>      </xsl:choose>
     <xsl:if test="@type">      <xsl:if test="@type">
       <xsl:value-of select="$messages/message[@label='type:']"/><xsl:text> </xsl:text><xsl:call-template name="nomtype"/><br/>        <xsl:value-of select="$messages/message[@label='type:']"/><xsl:text> </xsl:text>
         <xsl:call-template name="nomtype">
           <xsl:with-param name="type" select="@type"/>
         </xsl:call-template>
         <br/>
     </xsl:if>      </xsl:if>
     <xsl:apply-templates/>      <xsl:apply-templates/>
     </div>      </div>
Line 213  body { color: #000000; background: #FFFF Line 239  body { color: #000000; background: #FFFF
       <xsl:when test="@name!=''">        <xsl:when test="@name!=''">
         <xsl:variable name="numero" select="count(preceding::*[@name=current()/@name])"/>          <xsl:variable name="numero" select="count(preceding::*[@name=current()/@name])"/>
         <a name="{@name}_{$numero}"/>          <a name="{@name}_{$numero}"/>
         <h3><xsl:value-of select="$messages/message[@label='Type simple']"/><xsl:text> </xsl:text><span class="nomtitre"><xsl:value-of select="@name"/></span></h3>          <h3><xsl:value-of select="$messages/message[@label='Type simple']"/><xsl:text> </xsl:text>
           <span class="nomtitre"><xsl:value-of select="@name"/></span></h3>
         <xsl:apply-templates/>          <xsl:apply-templates/>
         <hr/>          <hr/>
       </xsl:when>        </xsl:when>
Line 238  body { color: #000000; background: #FFFF Line 265  body { color: #000000; background: #FFFF
     </xsl:if>      </xsl:if>
   </xsl:template>    </xsl:template>
       
     <xsl:template match="xs:union">
       <xsl:value-of select="$messages/message[@label='Union des types']"/>
       <ul>
         <xsl:if test="@memberTypes!=''">
           <xsl:call-template name="union-members">
             <xsl:with-param name="types" select="@memberTypes"/>
           </xsl:call-template>
         </xsl:if>
         <xsl:for-each select="xs:simpleType">
           <li><xsl:apply-templates select="."/></li>
         </xsl:for-each>
       </ul>
     </xsl:template>
     
   <xsl:template match="xs:enumeration">    <xsl:template match="xs:enumeration">
     <li><tt><xsl:value-of select="@value"/></tt></li>      <li><tt><xsl:value-of select="@value"/></tt></li>
   </xsl:template>    </xsl:template>
Line 287  body { color: #000000; background: #FFFF Line 328  body { color: #000000; background: #FFFF
     <xsl:otherwise>      <xsl:otherwise>
       <xsl:variable name="numero" select="count(preceding::*[@name=current()/@name])"/>        <xsl:variable name="numero" select="count(preceding::*[@name=current()/@name])"/>
       <a name="{@name}_{$numero}"/>        <a name="{@name}_{$numero}"/>
       <h3><xsl:value-of select="$messages/message[@label='Groupe d attributs:']"/><xsl:text> </xsl:text><span class="nomtitre"><xsl:value-of select="@name"/></span></h3>        <h3><xsl:value-of select="$messages/message[@label='Groupe d attributs:']"/><xsl:text> </xsl:text>
         <span class="nomtitre"><xsl:value-of select="@name"/></span></h3>
       <xsl:apply-templates/>        <xsl:apply-templates/>
       <br/>        <br/>
       <xsl:for-each select="//xs:element[.//xs:attributeGroup[@ref=current()/@name or substring-after(@ref,':')=current()/@name]] | //xs:attributeGroup[.//xs:attributeGroup[@ref=current()/@name or substring-after(@ref,':')=current()/@name]] | //xs:complexType[.//xs:attributeGroup[@ref=current()/@name or substring-after(@ref,':')=current()/@name] and @name]">        <xsl:for-each select="//xs:element[.//xs:attributeGroup[@ref=current()/@name or substring-after(@ref,':')=current()/@name]] | //xs:attributeGroup[.//xs:attributeGroup[@ref=current()/@name or substring-after(@ref,':')=current()/@name]] | //xs:complexType[.//xs:attributeGroup[@ref=current()/@name or substring-after(@ref,':')=current()/@name] and @name]">
         <xsl:if test="position() = 1">          <xsl:if test="position() = 1">
           <xsl:value-of select="$messages/message[@label='Parents:']"/>            <xsl:value-of select="$messages/message[@label='Parents:']"/><xsl:text> </xsl:text>
         </xsl:if>          </xsl:if>
         <xsl:if test="position() != 1">, </xsl:if>          <xsl:if test="position() != 1">, </xsl:if>
         <xsl:variable name="numero2"><xsl:value-of select="count(preceding::*[@name=current()/@name])"/></xsl:variable>          <xsl:variable name="numero2" select="count(preceding::*[@name=current()/@name])"/>
         <a href="#{@name}_{$numero2}"><xsl:value-of select="@name"/></a>           <a href="#{@name}_{$numero2}"><xsl:value-of select="@name"/></a> 
       </xsl:for-each>        </xsl:for-each>
       <br/>        <br/>
Line 304  body { color: #000000; background: #FFFF Line 346  body { color: #000000; background: #FFFF
     </xsl:choose>      </xsl:choose>
   </xsl:template>    </xsl:template>
   
     <xsl:template match="xs:import">
     </xsl:template>
     
   <xsl:template name="nomtype">    <xsl:template name="nomtype">
       <xsl:param name="type"/>
     <xsl:variable name="localType">      <xsl:variable name="localType">
       <xsl:choose>        <xsl:choose>
         <xsl:when test="contains(@type,':')">          <xsl:when test="contains($type,':')">
           <xsl:value-of select="substring-after(@type,':')"/>            <xsl:value-of select="substring-after($type,':')"/>
         </xsl:when>          </xsl:when>
         <xsl:otherwise>          <xsl:otherwise>
           <xsl:value-of select="@type"/>            <xsl:value-of select="$type"/>
         </xsl:otherwise>          </xsl:otherwise>
       </xsl:choose>        </xsl:choose>
     </xsl:variable>      </xsl:variable>
Line 323  body { color: #000000; background: #FFFF Line 369  body { color: #000000; background: #FFFF
           </xsl:for-each>            </xsl:for-each>
         </xsl:when>          </xsl:when>
         <xsl:otherwise>          <xsl:otherwise>
           <tt><xsl:value-of select="@type"/></tt>            <tt><xsl:value-of select="$type"/></tt>
         </xsl:otherwise>          </xsl:otherwise>
     </xsl:choose>      </xsl:choose>
   </xsl:template>    </xsl:template>
       
     <xsl:template name="rep-uri">    <xsl:template name="rep-uri">
         <!-- renvoit le chemin du répertoire d'un fichier à partir de l'URI complète, sous forme d'URI  -->      <!-- renvoit le chemin du répertoire d'un fichier à partir de l'URI complète, sous forme d'URI  -->
         <xsl:param name="chemin"/>      <xsl:param name="chemin"/>
         <!-- séparateur de chemins ( normalement / mais parfois \ avec file:// sur Windows ? ) -->      <!-- séparateur de chemins ( normalement / mais parfois \ avec file:// sur Windows ? ) -->
         <xsl:variable name="sepuri"><xsl:choose>      <xsl:variable name="sepuri"><xsl:choose>
             <xsl:when test="contains($chemin, '\')">\</xsl:when>        <xsl:when test="contains($chemin, '\')">\</xsl:when>
             <xsl:otherwise>/</xsl:otherwise>        <xsl:otherwise>/</xsl:otherwise>
         </xsl:choose></xsl:variable>      </xsl:choose></xsl:variable>
         <xsl:choose>      <xsl:choose>
             <xsl:when test="contains($chemin,$sepuri) and contains(substring-after($chemin,$sepuri),$sepuri)">        <xsl:when test="contains($chemin,$sepuri) and contains(substring-after($chemin,$sepuri),$sepuri)">
                 <xsl:value-of select="substring-before($chemin,$sepuri)"/><xsl:value-of select="$sepuri"/><xsl:call-template name="rep-uri"><xsl:with-param name="chemin" select="substring-after($chemin,$sepuri)"/></xsl:call-template>          <xsl:value-of select="substring-before($chemin,$sepuri)"/><xsl:value-of select="$sepuri"/><xsl:call-template name="rep-uri"><xsl:with-param name="chemin" select="substring-after($chemin,$sepuri)"/></xsl:call-template>
             </xsl:when>        </xsl:when>
             <xsl:otherwise>        <xsl:otherwise>
                 <xsl:value-of select="substring-before($chemin,$sepuri)"/>          <xsl:value-of select="substring-before($chemin,$sepuri)"/>
             </xsl:otherwise>        </xsl:otherwise>
         </xsl:choose>      </xsl:choose>
     </xsl:template>    </xsl:template>
           
     <xsl:template name="union-members">
       <xsl:param name="types"/>
       <xsl:variable name="nt" select="normalize-space($types)"/>
       <xsl:if test="$nt!=''">
         <xsl:choose>
           <xsl:when test="contains($nt,' ')">
             <xsl:call-template name="union-members">
               <xsl:with-param name="types" select="substring-before($nt, ' ')"/>
             </xsl:call-template>
             <xsl:call-template name="union-members">
               <xsl:with-param name="types" select="substring-after($nt, ' ')"/>
             </xsl:call-template>
           </xsl:when>
           <xsl:otherwise>
             <li>
               <xsl:call-template name="nomtype">
                 <xsl:with-param name="type" select="$nt"/>
               </xsl:call-template>
             </li>
           </xsl:otherwise>
         </xsl:choose>
       </xsl:if>
     </xsl:template>
    
 </xsl:stylesheet>  </xsl:stylesheet>

Removed from v.1.1  
changed lines
  Added in v.1.2


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>