<html>
<head>


<title>&lt;xsl:attribute-set&gt;</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div id="Description">
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="main">
<tr>
<td valign="top" class="NAME">&lt;xsl:attribute-set&gt;</td>
<td valign="top" class="COMPATIBILITY">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
</tr>
<tr>
<td valign="top" colspan="2" class="description">
Permet de d&eacute;finir un groupe d'attributs pour le document de sortie. Vous pouvez alors cr&eacute;er une r&eacute;f&eacute;rence pour l'ensemble du groupe d'attributs plut&ocirc;t que de cr&eacute;er tous les attributs individuellement. </td></tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Cat&eacute;gorie</td>
</tr>
<tr>
<td colspan="2" class="description">
<p>El&eacute;ment de niveau sup&eacute;rieur</p>
</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Attributs obligatoires</td>
</tr>
<tr>
<td colspan="2" class="description">
<dl>
<dt>
name
</dt>
<dd>
D&eacute;finit le nom de l'ensemble d'attributs.
<P></p>
</dl>
</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Attributs facultatifs</td>
</tr>
<tr>
<td colspan="2" class="description">
<dl>
<dt>
use-attribute-sets
</dt>
<dd>
R&eacute;pertorie un ou plusieurs ensembles d'attributs qui devraient &ecirc;tre utilis&eacute;s par cet ensemble d'attributs. Si vous indiquez plusieurs ensembles, s&eacute;parez leurs noms par des espaces blancs. Vous pouvez utiliser cet attribut pour incorporer d'autres <span class="LITERAL">&lt; xsl:attribute-set &gt;</span> dans celui-ci, mais notez qu'un <span class="LITERAL">&lt; xsl:attribute-set &gt;</span> qui s'incorpore directement ou indirectement g&eacute;n&egrave;re une erreur. En d'autres termes, si un ensemble d'attributs <span class="LITERAL">A</span> incorpore un ensemble d'attributs <span class="LITERAL">B</span>, qui &agrave; son tour incorpore un ensemble d'attributs <span class="LITERAL">C</span>, lui-m&ecirc;me incorporant un ensemble d'attributs <span class="LITERAL">A</span>, le processeur XSLT signalera une erreur.
<P></p>
</dl>
</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Contenu</td>
</tr>
<tr>
<td colspan="2" class="description">
<p>Un ou plusieurs &eacute;l&eacute;ments <span class="LITERAL">&lt;xsl:attribute&gt;</span>.</p>
</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Appara&icirc;t dans</td>
</tr>
<tr>
<td colspan="2" class="description">
<p>
<span class="LITERAL">&lt;xsl:stylesheet&gt;</span>. L'&eacute;l&eacute;ment <span class="LITERAL">&lt;xsl:attribute-set&gt;</span> est un &eacute;l&eacute;ment de niveau sup&eacute;rieur ne pouvant appara&icirc;tre que comme l'enfant de <span class="LITERAL">&lt;xsl:stylesheet&gt;</span>.</p>
</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">D&eacute;fini dans</td>
</tr>
<tr>
<td colspan="2" class="description">
<p>XSLT section 7.1.4, Ensembles d'attributs nomm&eacute;s.</p>
</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Exemple</td>
</tr>
<tr>
<td colspan="2" class="description">
<p>Pour cet exemple, on cr&eacute;e une feuille de style d&eacute;finissant des ensembles d'attributs pour du texte normal, du texte en gras et du texte large. Pour changer simplement, la sp&eacute;cification XSL-FO est utilis&eacute;e pour convertir le document XML en fichier PDF. La feuille de style est la suivante&nbsp;:</p>
<span class="PROGRAMLISTING"><pre>
&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;xsl:stylesheet version=&quot;1.0&quot;
  xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
  xmlns:fo=&quot;http://www.w3.org/1999/XSL/Format&quot;&gt;

  &lt;xsl:output method=&quot;html&quot;/&gt;

  &lt;xsl:attribute-set name=&quot;regular-text&quot;&gt;
    &lt;xsl:attribute name=&quot;font-size&quot;&gt;12pt&lt;/xsl:attribute&gt;
    &lt;xsl:attribute name=&quot;font-family&quot;&gt;sans-serif&lt;/xsl:attribute&gt;
  &lt;/xsl:attribute-set&gt;

  &lt;xsl:attribute-set name=&quot;emphasized-text&quot; use-attribute-sets=&quot;regular-text&quot;&gt;
    &lt;xsl:attribute name=&quot;font-style&quot;&gt;italic&lt;/xsl:attribute&gt;
  &lt;/xsl:attribute-set&gt;

  &lt;xsl:attribute-set name=&quot;large-text&quot; use-attribute-sets=&quot;regular-text&quot;&gt;
    &lt;xsl:attribute name=&quot;font-size&quot;&gt;18pt&lt;/xsl:attribute&gt;
    &lt;xsl:attribute name=&quot;font-weight&quot;&gt;bold&lt;/xsl:attribute&gt;
    &lt;xsl:attribute name=&quot;space-after.optimum&quot;&gt;21pt&lt;/xsl:attribute&gt;
  &lt;/xsl:attribute-set&gt;

  &lt;xsl:template match=&quot;/&quot;&gt;
    &lt;fo:root xmlns:fo=&quot;http://www.w3.org/1999/XSL/Format&quot;&gt;
      &lt;fo:layout-master-set&gt;
        &lt;fo:simple-page-master margin-right=&quot;75pt&quot; margin-left=&quot;75pt&quot; 
          page-height=&quot;11in&quot; page-width=&quot;8.5in&quot;
          margin-bottom=&quot;25pt&quot; margin-top=&quot;25pt&quot; master-name=&quot;main&quot;&gt;
          &lt;fo:region-before extent=&quot;25pt&quot;/&gt;
          &lt;fo:region-body margin-top=&quot;50pt&quot; margin-bottom=&quot;50pt&quot;/&gt;
          &lt;fo:region-after extent=&quot;25pt&quot;/&gt;
        &lt;/fo:simple-page-master&gt;
        &lt;fo:page-sequence-master master-name=&quot;standard&quot;&gt;
          &lt;fo:repeatable-page-master-alternatives&gt;
            &lt;fo:conditional-page-master-reference master-name=&quot;main&quot; 
              odd-or-even=&quot;any&quot;/&gt;
          &lt;/fo:repeatable-page-master-alternatives&gt;
        &lt;/fo:page-sequence-master&gt;
      &lt;/fo:layout-master-set&gt;
      
      &lt;fo:page-sequence master-name=&quot;standard&quot;&gt;
        &lt;fo:flow flow-name=&quot;xsl-region-body&quot;&gt;
          &lt;xsl:apply-templates select=&quot;list&quot;/&gt;
        &lt;/fo:flow&gt;
      &lt;/fo:page-sequence&gt;
    &lt;/fo:root&gt;
  &lt;/xsl:template&gt;

  &lt;xsl:template match=&quot;list&quot;&gt;
    &lt;fo:block xsl:use-attribute-sets=&quot;large-text&quot;&gt;
      &lt;xsl:value-of select=&quot;title&quot;/&gt;
    &lt;/fo:block&gt;
    &lt;fo:list-block provisional-distance-between-starts=&quot;0.4cm&quot;
      provisional-label-separation=&quot;0.15cm&quot;&gt;
      &lt;xsl:for-each select=&quot;listitem&quot;&gt;
        &lt;fo:list-item start-indent=&quot;0.5cm&quot; space-after.optimum=&quot;17pt&quot;&gt;
          &lt;fo:list-item-label&gt;
            &lt;fo:block xsl:use-attribute-sets=&quot;regular-text&quot;&gt;*&lt;/fo:block&gt;
          &lt;/fo:list-item-label&gt;
          &lt;fo:list-item-body&gt;
            &lt;fo:block xsl:use-attribute-sets=&quot;emphasized-text&quot;&gt;
              &lt;xsl:value-of select=&quot;.&quot;/&gt;
            &lt;/fo:block&gt;
          &lt;/fo:list-item-body&gt;
        &lt;/fo:list-item&gt;
      &lt;/xsl:for-each&gt;
    &lt;/fo:list-block&gt;
  &lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;</pre></span>
<p>Les deux ensembles d'attributs <span class="LITERAL">emphasized-text</span> et <span class="LITERAL">large-text</span> utilisent comme base l'ensemble d'attributs <span class="LITERAL">regular-text</span>.  Dans le cas de l'ensemble <span class="LITERAL">large-text</span>, l'attribut <span class="LITERAL">font-size</span> d&eacute;fini dans l'ensemble d'attributs <span class="LITERAL">large-text</span> remplace l'attribut <span class="LITERAL">font-size</span> inclus &agrave; partir de l'ensemble d'attributs <span class="LITERAL">regular-text</span>.  Cette feuille de style est appliqu&eacute;e au document XML suivant&nbsp;:</p>
<span class="PROGRAMLISTING"><pre>
&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;list&gt;
  &lt;title&gt;A few of my favorite albums&lt;/title&gt;
  &lt;listitem&gt;A Love Supreme&lt;/listitem&gt;
  &lt;listitem&gt;Beat Crazy&lt;/listitem&gt;
  &lt;listitem&gt;Here Come the Warm Jets&lt;/listitem&gt;
  &lt;listitem&gt;Kind of Blue&lt;/listitem&gt;
  &lt;listitem&gt;London Calling&lt;/listitem&gt;
  &lt;listitem&gt;Remain in Light&lt;/listitem&gt;
  &lt;listitem&gt;The Joshua Tree&lt;/listitem&gt;
  &lt;listitem&gt;The Indestructible Beat of Soweto&lt;/listitem&gt;
&lt;/list&gt;</pre></span>
<p>La feuille de style g&eacute;n&egrave;re le fichier suivant, d'aspect un peu d&eacute;sordonn&eacute;, d'objets de formatage qui d&eacute;crivent la mani&egrave;re dont le texte du document XML source devrait s'afficher&nbsp;:  </p>
<span class="PROGRAMLISTING"><pre>
&lt;fo:root xmlns:fo=&quot;http://www.w3.org/1999/XSL/Format&quot;&gt;
&lt;fo:layout-master-set&gt;
&lt;fo:simple-page-master master-name=&quot;main&quot; margin-top=&quot;25pt&quot; 
margin-bottom=&quot;25pt&quot; page-width=&quot;8.5in&quot; page-height=&quot;11in&quot; 
margin-left=&quot;75pt&quot; margin-right=&quot;75pt&quot;&gt;
&lt;fo:region-before extent=&quot;25pt&quot;/&gt;
&lt;fo:region-body margin-bottom=&quot;50pt&quot; margin-top=&quot;50pt&quot;/&gt;
&lt;fo:region-after extent=&quot;25pt&quot;/&gt;
&lt;/fo:simple-page-master&gt;
&lt;fo:page-sequence-master master-name=&quot;standard&quot;&gt;
&lt;fo:repeatable-page-master-alternatives&gt;
&lt;fo:conditional-page-master-reference odd-or-even=&quot;any&quot; master-name=&quot;main&quot;/&gt;
&lt;/fo:repeatable-page-master-alternatives&gt;
&lt;/fo:page-sequence-master&gt;
&lt;/fo:layout-master-set&gt;
&lt;fo:page-sequence master-name=&quot;standard&quot;&gt;
&lt;fo:flow flow-name=&quot;xsl-region-body&quot;&gt;
&lt;fo:block font-size=&quot;18pt&quot; font-family=&quot;sans-serif&quot; 
font-weight=&quot;bold&quot; space-after.optimum=&quot;21pt&quot;&gt;A few of my 
favorite albums&lt;/fo:block&gt;
&lt;fo:list-block provisional-label-separation=&quot;0.15cm&quot; 
provisional-distance-between-starts=&quot;0.4cm&quot;&gt;
&lt;fo:list-item space-after.optimum=&quot;17pt&quot; start-indent=&quot;0.5cm&quot;&gt;
&lt;fo:list-item-label&gt;
&lt;fo:block font-size=&quot;12pt&quot; font-family=&quot;sans-serif&quot;&gt;*&lt;/fo:block&gt;
&lt;/fo:list-item-label&gt;
&lt;fo:list-item-body&gt;
&lt;fo:block font-size=&quot;12pt&quot; font-family=&quot;sans-serif&quot; 
font-style=&quot;italic&quot;&gt;A Love Supreme&lt;/fo:block&gt;
&lt;/fo:list-item-body&gt;
&lt;/fo:list-item&gt;
&lt;fo:list-item space-after.optimum=&quot;17pt&quot; start-indent=&quot;0.5cm&quot;&gt;
&lt;fo:list-item-label&gt;
&lt;fo:block font-size=&quot;12pt&quot; font-family=&quot;sans-serif&quot;&gt;*&lt;/fo:block&gt;
&lt;/fo:list-item-label&gt;
&lt;fo:list-item-body&gt;
&lt;fo:block font-size=&quot;12pt&quot; font-family=&quot;sans-serif&quot; 
font-style=&quot;italic&quot;&gt;Beat Crazy&lt;/fo:block&gt;
&lt;/fo:list-item-body&gt;
&lt;/fo:list-item&gt;
&lt;fo:list-item space-after.optimum=&quot;17pt&quot; start-indent=&quot;0.5cm&quot;&gt;
&lt;fo:list-item-label&gt;
&lt;fo:block font-size=&quot;12pt&quot; font-family=&quot;sans-serif&quot;&gt;*&lt;/fo:block&gt;
&lt;/fo:list-item-label&gt;
&lt;fo:list-item-body&gt;
&lt;fo:block font-size=&quot;12pt&quot; font-family=&quot;sans-serif&quot; 
font-style=&quot;italic&quot;&gt;Here Come the Warm Jets&lt;/fo:block&gt;
&lt;/fo:list-item-body&gt;
&lt;/fo:list-item&gt;
&lt;fo:list-item space-after.optimum=&quot;17pt&quot; start-indent=&quot;0.5cm&quot;&gt;
&lt;fo:list-item-label&gt;
&lt;fo:block font-size=&quot;12pt&quot; font-family=&quot;sans-serif&quot;&gt;*&lt;/fo:block&gt;
&lt;/fo:list-item-label&gt;
&lt;fo:list-item-body&gt;
&lt;fo:block font-size=&quot;12pt&quot; font-family=&quot;sans-serif&quot; 
font-style=&quot;italic&quot;&gt;Kind of Blue&lt;/fo:block&gt;
&lt;/fo:list-item-body&gt;
&lt;/fo:list-item&gt;
&lt;fo:list-item space-after.optimum=&quot;17pt&quot; start-indent=&quot;0.5cm&quot;&gt;
&lt;fo:list-item-label&gt;
&lt;fo:block font-size=&quot;12pt&quot; font-family=&quot;sans-serif&quot;&gt;*&lt;/fo:block&gt;
&lt;/fo:list-item-label&gt;
&lt;fo:list-item-body&gt;
&lt;fo:block font-size=&quot;12pt&quot; font-family=&quot;sans-serif&quot; 
font-style=&quot;italic&quot;&gt;London Calling&lt;/fo:block&gt;
&lt;/fo:list-item-body&gt;
&lt;/fo:list-item&gt;
&lt;fo:list-item space-after.optimum=&quot;17pt&quot; start-indent=&quot;0.5cm&quot;&gt;
&lt;fo:list-item-label&gt;
&lt;fo:block font-size=&quot;12pt&quot; font-family=&quot;sans-serif&quot;&gt;*&lt;/fo:block&gt;
&lt;/fo:list-item-label&gt;
&lt;fo:list-item-body&gt;
&lt;fo:block font-size=&quot;12pt&quot; font-family=&quot;sans-serif&quot; 
font-style=&quot;italic&quot;&gt;Remain in Light&lt;/fo:block&gt;
&lt;/fo:list-item-body&gt;
&lt;/fo:list-item&gt;
&lt;fo:list-item space-after.optimum=&quot;17pt&quot; start-indent=&quot;0.5cm&quot;&gt;
&lt;fo:list-item-label&gt;
&lt;fo:block font-size=&quot;12pt&quot; font-family=&quot;sans-serif&quot;&gt;*&lt;/fo:block&gt;
&lt;/fo:list-item-label&gt;
&lt;fo:list-item-body&gt;
&lt;fo:block font-size=&quot;12pt&quot; font-family=&quot;sans-serif&quot; 
font-style=&quot;italic&quot;&gt;The Joshua Tree&lt;/fo:block&gt;
&lt;/fo:list-item-body&gt;
&lt;/fo:list-item&gt;
&lt;fo:list-item space-after.optimum=&quot;17pt&quot; start-indent=&quot;0.5cm&quot;&gt;
&lt;fo:list-item-label&gt;
&lt;fo:block font-size=&quot;12pt&quot; font-family=&quot;sans-serif&quot;&gt;*&lt;/fo:block&gt;
&lt;/fo:list-item-label&gt;
&lt;fo:list-item-body&gt;
&lt;fo:block font-size=&quot;12pt&quot; font-family=&quot;sans-serif&quot; 
font-style=&quot;italic&quot;&gt;The Indestructible Beat of Soweto&lt;/fo:block&gt;
&lt;/fo:list-item-body&gt;
&lt;/fo:list-item&gt;
&lt;/fo:list-block&gt;
&lt;/fo:flow&gt;
&lt;/fo:page-sequence&gt;
&lt;/fo:root&gt;</pre></span>
<p>Concernant cette r&eacute;daction (mai 2001), la sp&eacute;cification XSL-FO n'est pas d&eacute;finitive, il n'y a donc aucune garantie que ces objets de formatage fonctionnent correctement avec les futurs outils XSL-FO. Voici la m&eacute;thode utilis&eacute;e pour invoquer l'outil FOP du projet Apache XML (objets de formatage du traducteur PDF) en vue de cr&eacute;er un PDF&nbsp;:</p>
<span class="PROGRAMLISTING"><pre>
java org.apache.fop.apps.CommandLine test.fo test.pdf</pre></span>
<p>L'outil FOP cr&eacute;e un PDF qui ressemble &agrave; la <link linkend="xslt-appa-a4">Figure A-4</link>.</p>
<figure label="A-4" id="xslt-appa-a4">
        <p class="TITLE">PDF g&eacute;n&eacute;r&eacute; &agrave; partir d'un fichier XSL-FO</p>
        <graphic depth="309" width="455" fileref="figs/xslt.aa04.gif"/></figure>
</td>
</tr>
</table>
</div>
</body>
</html>
