What is Difference between XSL-FO and XSLT

In this articles i am going to explain about the Difference between XSL-FO and XSLT
  • 3152

XSL-FO and XSLT in XML

  • XSLT is a means for transforming XML documents.

  • XSLT is a language one uses to specify a conversion from one(XML) format to another.

  • XSL-FO on the other hand is about formatting - about laying out content on a page or a sequence of pages in a strict fashion.

  • XSL-FO is useful because it allows you to manage content.

This example is the about XSL-FO Blocks.

<?xml version ="1.0" encoding="utf-8"?>

<fo:block font-size="14pt" font-family="verdana" color="red"

space-before="5mm" space-after="5mm">

  C-sharp Corner

</fo:block>

<fo:block text-indent="5mm" font-family="verdana" font-size="12pt">

  In C-sharp Corner you will find all the Web-building tutorials you

  need, from basic HTML and XHTMl, C#, Wpf, SilverLight, XML, ADO.NEt, ASP.

</fo:block>

 

Output

 

C-sharp Corner

In C-sharp Corner you will find all the Web-building tutorials you

need,from basic HTML and XHTMl, C#, Wpf, SilverLight, XML, ADO.NEt, ASP.

 

This example is the about XSLT.

 

<header>C-sharp Corner</header>

<paragraph>

  In C-sharp Corner you will find all the Web-building tutorials you

  need, from basic HTML and XHTMl, C#, Wpf, SilverLight, XML, ADO.NEt, ASP.

</paragraph>

 

Add an XSLT tranformation.

 

<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>

 

Output

 

C-sharp Corner

In C-sharp Corner you will find all the Web-building tutorials you

need,from basic HTML and XHTMl, C#, Wpf, SilverLight, XML, ADO.NEt, ASP.

Further Readings

You may also want to read these related articles :

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

© 2019 DotNetHeaven. All rights reserved.