Tecnologías XML / XSL-FO / Ejemplos de aplicación / Títulos con numeración compleja

 

Títulos con numeración compleja

Las tablas permiten componer adecuadamente numeraciones multinivel generadas.

Como en numeración simple, las tablas estructuran títulos complejos. La estructura coincide con «Títulos con numeración simple».
Por eso no se ofrecen más comentarios aquí.

Extracto de DTD:

<!ELEMENT Teil (Titel, Beitrag+)>
<!ELEMENT Beitrag (Titel, ..., Abschnitt*)>                  ❶
<!ELEMENT Abschnitt (Titel, ..., Abschnitt*)>                ❶
<!ELEMENT Titel (#PCDATA | ...)*>

❶ Partes, artículos y secciones opcionales forman tres niveles; las secciones pueden ser recursivas. En esta hoja, <Teil> no se numera. <Beitrag> se numera continuamente entre partes. Los niveles inferiores (<Abschnitt>) se numeran hasta el tercer subnivel, como máximo «1.1.1.1».

Hoja de estilo:

<xsl:template match="Teil/Beitrag/Abschnitt/Titel">                                ❶
   <fo:block xsl:use-attribute-sets="Ueberschrift-Titel2" hyphenate="false">
      <fo:table width="110mm">
         <fo:table-column column-number="1" column-width="15mm"/> 
         <fo:table-column column-number="2" column-width="95mm"/>
         <fo:table-body>
            <fo:table-row>
               <fo:table-cell column-number="1">
                  <fo:block>
                     <xsl:number level="any" count="Teil/Beitrag" format="1."/>    ❷
                     <xsl:number level="multiple" count="Beitrag/Abschnitt |       ❸
                        Beitrag/Abschnitt/Abschnitt | Beitrag/Abschnitt/
                        Abschnitt/Abschnitt" format="1.1"/> 
                  </fo:block>
               </fo:table-cell>
               <fo:table-cell column-number="2">
                  <fo:block>
                     <xsl:apply-templates/>
                  </fo:block>
               </fo:table-cell>
            </fo:table-row>
         </fo:table-body> 
      </fo:table>
   </fo:block>
</xsl:template>

❶ La plantilla solo se aplica a títulos del primer nivel de sección.

❷ El primer elemento <xsl:number> numera artículos. El atributo level con valor any cuenta entre partes; el atributo count selecciona artículos, y el atributo format define cifras arábigas seguidas de punto.

❸ El segundo elemento <xsl:number> numera secciones. El atributo level con valor multiple reinicia en uno al cambiar el padre; el atributo count selecciona hasta el tercer subnivel, mientras que el atributo format utiliza cifras arábigas separadas por puntos, sin punto final. Enumere todos los niveles en el atributo count como alternativas unidas por O.

 

<< atrás

siguiente >>

volver arriba