XSL-FO e XSLT
XSL-FO e XSLT possono aiutarsi a vicenda.
Ricordate questo esempio?
<fo:block
font-size="14pt" font-family="verdana" color="red"
space-before="5mm" space-after="5mm">
W3CSchool
</fo:block>
<fo:block text-indent="5mm" font-family="verdana" font-size="12pt">
At W3CSchool you will find all the Web-building tutorials you
need, from basic HTML and XHTML to advanced XML, XSL, Multimedia and WAP.
</fo:block>
space-before="5mm" space-after="5mm">
W3CSchool
</fo:block>
<fo:block text-indent="5mm" font-family="verdana" font-size="12pt">
At W3CSchool you will find all the Web-building tutorials you
need, from basic HTML and XHTML to advanced XML, XSL, Multimedia and WAP.
</fo:block>
risultati:
W3CSchool In W3CSchool troverete tutti i tutorial Web-all'edificio bisogna, da HTML di base e XHTML a XML avanzato, XSL, Multimedia e WAP. |
L'esempio di cui sopra da quel capitolo su un'area del blocco XSL-FO.
Aiuto dal XSLT
XSL-FO viene rimosso dal documento:
<header>W3CSchool</header>
<paragraph>At W3CSchool you will find all the Web-building tutorials you
need, from basic HTML and XHTML to advanced XML, XSL, Multimedia and WAP.
</paragraph>
<paragraph>At W3CSchool you will find all the Web-building tutorials you
need, from basic HTML and XHTML to advanced XML, XSL, Multimedia and WAP.
</paragraph>
Aggiungere trasformazione XSLT:
<xsl:template match="header">
<fo:block font-size="14pt" font-family="verdana" color="red"
space-before="5mm" space-after="5mm">
<xsl:apply-templates/>
</fo:block>
</xsl:template>
<xsl:template match="paragraph">
<fo:block text-indent="5mm" font-family="verdana" font-size="12pt">
<xsl:apply-templates/>
</fo:block>
</xsl:template>
<fo:block font-size="14pt" font-family="verdana" color="red"
space-before="5mm" space-after="5mm">
<xsl:apply-templates/>
</fo:block>
</xsl:template>
<xsl:template match="paragraph">
<fo:block text-indent="5mm" font-family="verdana" font-size="12pt">
<xsl:apply-templates/>
</fo:block>
</xsl:template>
Il risultato è lo stesso:
W3CSchool In W3CSchool troverete tutti i tutorial Web-all'edificio bisogna, da HTML di base e XHTML a XML avanzato, XSL, Multimedia e WAP. |