L'objectif de XSL-FO est de créer un arbre d'aires où une aire est une zone d'affichage (visuelle ou auditive). Il existe deux types d'aires : • Les aires de blocs qui s'empilent les unes sur les autres. • Les aires en-ligne qui s'empilent les unes à côté des autres. ![]()
<?xml version="1.0" ?> <xsl:stylesheet xmlns:xsl="http//www.w3.org/1999/XSL/Transform" version="1.0" xmlns:fo="http://www.w3.org/1999/XSL/Format"> <xsl:template match="/"> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> <fo:block font="verdana" font-size="30pt" align="center"> <xsl:value-of select="texte/contenu" /> </fo:block> </fo:root> </xsl:template> </xsl:stylesheet> ![]() Voici donc le fichier XSL/FO, "monfichier.xsl" à recopier
<?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"> <xsl:template match="macompile/mp3"> <fo:root> <fo:layout-master-set> <fo:simple-page-master master-name="first" margin-left="2cm" margin-right="2cm" margin-bottom="0.5cm" margin-top="0.75cm" page-width="21cm" page-height="29.7cm"> <fo:region-body/> </fo:simple-page-master> </fo:layout-master-set> <fo:page-sequence master-name="first"> <fo:flow flow-name="xsl-region-body" font-size="14pt" line-height="14pt"> <xsl:apply-templates /> </fo:flow> </fo:page-sequence> </fo:root> </xsl:template> <xsl:template match="titre"> <fo:block font-size="36pt" text-align="center" line-height="40pt" space-before="0.5cm" space-after="1.0cm"> <xsl:apply-templates/> </fo:block> </xsl:template> </xsl:stylesheet> XSL-FO est un langage d'une haute technicité qui s'adresse principalement aux typographes. Plus d'infos sur Ecrion |