« Programmation XML/XSL-FO » : différence entre les versions
m <source> -> <syntaxhighlight> (phab:T237267) |
Aucun résumé des modifications |
||
Ligne 66 : | Ligne 66 : | ||
{| cellpadding="0" cellspacing="0" width="60%" border="0" align="center" |
{| cellpadding="0" cellspacing="0" width="60%" border="0" align="center" |
||
|- <!-- 1ère ligne --> |
|- <!-- 1ère ligne --> |
||
| colspan="4" style="border-left: 1px solid |
| colspan="4" style="border-left: 1px solid ; border-top: 1px solid ;" align="center" | ''Page viewport area'' |
||
| colspan="3" style="border-top: 1px solid |
| colspan="3" style="border-top: 1px solid ; border-right: 1px solid ;" width="50%" | I margin-top |
||
|- <!-- 2ème ligne --> |
|- <!-- 2ème ligne --> |
||
| width="5%" style="border-left: 1px solid |
| width="5%" style="border-left: 1px solid ; border-right: 1px dashed;" | |
||
| colspan="5" style="border-top: 1px dashed |
| colspan="5" style="border-top: 1px dashed; border-bottom: 1px solid ; " align="center" | region-before<br/>region viewport area |
||
| width="5%" style="border-left: 1px dashed |
| width="5%" style="border-left: 1px dashed; border-right: 1px solid;" | |
||
|- <!-- 3ème ligne --> |
|- <!-- 3ème ligne --> |
||
| width="5%" style="border-left: 1px solid |
| width="5%" style="border-left: 1px solid ; border-right: 1px dashed ;" | |
||
| width="5%" style="border-right: 1px solid |
| width="5%" style="border-right: 1px solid ;" | |
||
| colspan="3" style="border-right: 1px solid |
| colspan="3" style="border-right: 1px solid ;" | <br/> |
||
| width="5%" style="border-right: 1px dashed |
| width="5%" style="border-right: 1px dashed;" | |
||
| width="5%" style="border-right: 1px solid |
| width="5%" style="border-right: 1px solid ;" | |
||
|- <!-- 4ème ligne --> |
|- <!-- 4ème ligne --> |
||
| width="5%" style="border-left: 1px solid |
| width="5%" style="border-left: 1px solid ; border-right: 1px dashed ;" align="center" | ___<br/>[[Image:Point rouge.gif|margin-left]] |
||
| width="5%" style="border-right: 1px solid |
| width="5%" style="border-right: 1px solid ;" align="center" | [[Image:Point rouge.gif|Region-start - region viewport area]] |
||
| width="5%" style="border-right: 1px solid |
| width="5%" style="border-right: 1px solid ;" | |
||
| width="60%" style="border-right: 1px solid |
| width="60%" style="border-right: 1px solid ; border-top: 1px solid ; border-bottom: 1px solid ;background-color:#ffcf8340;text-align:center;"| <br/><br/>Region-body<br/>region viewport area<br/><br/> <br/><br/> <br/><br/> |
||
| width="5%" style="border-right: 1px solid |
| width="5%" style="border-right: 1px solid ;" | |
||
| width="5%" style="border-right: 1px dashed |
| width="5%" style="border-right: 1px dashed;" align="center" | [[Image:Point rouge.gif|Region-end - region viewport area]] |
||
| width="5%" style="border-right: 1px solid |
| width="5%" style="border-right: 1px solid ;" align="center" | ___<br/>[[Image:Point rouge.gif|margin-right]] |
||
|- <!-- 5ème ligne --> |
|- <!-- 5ème ligne --> |
||
| width="5%" style="border-left: 1px solid |
| width="5%" style="border-left: 1px solid ; border-right: 1px dashed ;" | |
||
| width="5%" style="border-right: 1px solid |
| width="5%" style="border-right: 1px solid ;" | |
||
| colspan="3" style="border-right: 1px solid |
| colspan="3" style="border-right: 1px solid ;" | <br/> |
||
| width="5%" style="border-right: 1px dashed |
| width="5%" style="border-right: 1px dashed;" | |
||
| width="5%" style="border-right: 1px solid |
| width="5%" style="border-right: 1px solid ;" | |
||
|- <!-- 6ème ligne --> |
|- <!-- 6ème ligne --> |
||
| width="5%" style="border-left: 1px solid |
| width="5%" style="border-left: 1px solid ; border-right: 1px dashed ;" | |
||
| colspan="5" style="border-top: 1px solid |
| colspan="5" style="border-top: 1px solid ; border-right: 1px dashed ; border-bottom: 1px dashed; " align="center" | region-after<br/>region viewport area |
||
| width="5%" style="border-right: 1px solid |
| width="5%" style="border-right: 1px solid;" | |
||
|- <!-- 7ème ligne --> |
|- <!-- 7ème ligne --> |
||
| colspan="4" style="border-left: 1px solid |
| colspan="4" style="border-left: 1px solid; border-bottom: 1px solid ;" align="center" | |
||
| colspan="3" style="border-bottom:1px solid |
| colspan="3" style="border-bottom:1px solid; border-right: 1px solid ;" | I margin-bottom |
||
|- |
|||
|} |
|} |
||
Version du 10 octobre 2021 à 13:08
Introduction à XSL-FO
XSL-FO (eXtensible Stylesheet Language - Formatting Objects) dans la recommandation XSL du W3C est le vocabulaire qui décrit les mises en forme de documents XML quel que soit le support : écran, papier mais aussi dispositifs mobiles ou audio...
XSL-FO est un langage d'une haute technicité qui s'adresse principalement aux typographes afin de fournir avec les outils de gestion de documents, un outil typographique du niveau attendu par les publications imprimées.
L'objectif de XSL-FO est de créer un arbre d'aires où une aire est une zone d'affichage (visuelle ou auditive).
Les aires sont de deux types :
- Les aires de blocs s'empilent les unes sur les autres,
- Les aires en-ligne s'empilent les unes à côté des autres.
XSL-FO fournit l'ensemble des commandes de contrôle de chaque aire : présentation du contenu, direction de l'empilement (écriture de gauche à droite ou inversement, de haut en bas...).
Ces commandes sont dans des balises <fo: et on les enregistre dans des documents .xfo, .fo ou .fob.
Un document "Bonjour le monde"
Le résultat du code suivant est Hello world[1] :
<?xml version="1.0" encoding="UTF-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="A4">
<fo:region-body />
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="A4">
<fo:flow flow-name="xsl-region-body">
<fo:block>Hello world</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
Le modèle des aires
Modèle d'une page simple
Format du tableau : ------------------------------------ -- | | 1 | ------------------------ | -- | | | | 2 | ------------------------ | -- | | | | | | 3 | | | ------- | | | -- | | | | | | | | 4 | | | | | | | | | | | | | | | | | | | | | | | | | | | ------- | | | -- | | | | | | 5 | ------------------------ | -- | | | | 6 | ------------------------ | -- | | 7 ------------------------------------ -- | 1 | 2 | 3 | 4 |5| 6 | 7 |
Page viewport area | I margin-top | |||||
region-before region viewport area |
||||||
|
||||||
___ |
Region-body region viewport area |
___ | ||||
|
||||||
region-after region viewport area |
||||||
I margin-bottom |
L'affinage et la résolution des propriétés
Les objets de mise en forme
Les propriétés de mise en forme
Références
Liens externes
La dernière vérification concernant les liens externes a été effectuée le le 25 janvier 2006.
- (anglais) w3.org Recommandation du W3C.
- (français) yoyodesign.org Traduction de la recommandation du W3C version 1.0 du 15 octobre 2001.
- (anglais) w3schools.com Apprendre XSL-FO avec w3schools (tutorial, documentation...)
- (anglais) xml.apache.org FOP, le moteur XSL-FO d'Apache
- FOP est une application Java qui accepte un document FO et génère une page dans différents formats : PDF, PCL, PS, SVG, XML, Print, AWT, MIF and TXT. Le principal format de sortie étant le PDF.