Hardis - Séquence de feuilletage |
---|
Cette bibliothèque regroupe un certain nombre de macros permettant de définir un document au format XSL-FO. Ces directives doivent être appelées en précisant l'espace de noms "hardisFo" :
Pas de format |
---|
<@hardisFo.toolMacro parameters>...</@hardisFo.toolMacro>$toolMacro> ${ hardisFo.toolFunction(...) } |
...
Lors du traitement d'un template, l'exécution d'une macro hardisFo.foXXX produira dans le document résultat le fragment de code XSL-FO suivant : <fo:XXX ...> ... </fo:XXX>.
Chaque appel de macro hardisFo.foXXX doit être correctement imbriqué dans la bonne macro hardisFo.foXXX parente, comme spécifié par le langage XSL-FO.
Par exemple, la spécification XSL v1.1 impose qu'une balise <fo:flow> ne peut être placée qu'à l'intérieur d'une balise <fo:page-sequence>, donc la macro hardisFo.foFlow ne pourra être appelée que dans le contenu imbriqué d'une macro hardisFo.foPageSequence.
Seules les balises XSL-FO supportées par le moteur Apache FOP 2.2 ont été portées (cliquez ici pour plus de détails).
Info | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
|
Convention de nommage des macros hardisFo.foXXX
...
La règle de renommage est la suivante : le nom de balise XXX est converti de sa notation Kebab case en notation Camel case.
...
Tableau de correspondances :
Hardis - Tableau personnalisé | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hardis - Haut de page |
---|
↑ Haut de page |
Convention de nommage des paramètres des macros hardisFo.foXXX
...
La règle impose que le caractère "." soit converti en chaîne "Dot" et que le caractère ":" soit converti en chaîne "Colon". Par exemple, "block-progression-dimension.optimum" est converti en "blockProgressionDimensionDotOptimum" et "fox:border-radius" est converti en "foxColonBorderRadius".
Exemple de template de document XSL-FO écrit entièrement avec les macros :
Pas de format |
---|
<?xml version="1.0" encoding="utf-8"?><#> <#-- XSL-FO document using hardisFo macros --><@hardisFo> <@hardisFo.foRoot xmlns\:fox="http://xmlgraphics.apache.org/fop/extensions"><@hardisFo.foLayoutMasterSet><@hardisFo> <@hardisFo.foLayoutMasterSet> <@hardisFo.foSimplePageMaster masterName="sampleLayout" pageHeight="29.7cm" pageWidth="21cm" marginTop="2.5cm" marginBottom="2.5cm" marginLeft="1cm" marginRight="1cm"><@hardisFo> <@hardisFo.foRegionBody/><> </@hardisFo.foSimplePageMaster><foSimplePageMaster> </@hardisFo.foLayoutMasterSet><@hardisFofoLayoutMasterSet> <@hardisFo.foPageSequence masterReference="sampleLayout"><@hardisFo> <@hardisFo.foFlow flowName="xsl-region-body"><@hardisFo> <@hardisFo.foBlock fontSize="14pt" border="solid red 3pt" textAlign="center" foxColonBorderRadius="5pt"> Sample of CSS use</@hardisFo.foBlock><@hardisFo.foBlock>InfoBlock> <@hardisFo.foBlock> In this block, every inline text is <@hardisFo.foInline textTransform="uppercase">uppercase</@hardisFo.foInline><@hardisFo.foBlock>ThisfoInline> <@hardisFo.foBlock> This is the <@hardisFo.foInline textTransform="uppercase">second</@hardisFo.foInline> sentence. </@hardisFo.foBlock><@hardisFo.foBlock>ThisfoBlock> <@hardisFo.foBlock> This is the third sentence with a particular <@hardisFo.foInline id="specialText" textTransform="uppercase" color="green">inline text</@hardisFo.foInline>. </@hardisFo.foBlock><foBlock> </@hardisFo.foBlock><foBlock> </@hardisFo.foFlow><foFlow> </@hardisFo.foPageSequence><foPageSequence> </@hardisFo.foRoot> |
...
L'utilisation dans un template des bibliothèques hardisCSS et hardisAdv impose que le document XSL-FO soit entièrement écrit à l'aide des macros hardisFo.
Hardis - Haut de page |
---|
↑ Haut de page |
...