Jump to content

Difference between XSLT FO and XSLT


Guest chinni_K

Recommended Posts

Guest chinni_K

Hello,I have a presentation about XML, XSLT and XSD. I amwondering what if they ask me what is the difference between XSLT and XSL FOand XPath is, or why we should use the one over the other...I didn't know how to respond.I know that XSLT, a language for transforming XML documents XSL or XSL-FO, a language for formatting XML documents But when to use XSL FO and also what does we mean by formatting XML doumentsPlease reply me urgently.May be my question may find you like a KG standard but need your help in thisThanks in advance

Link to comment
Share on other sites

Huh. Now what do you know. I'm also making a presentation on XML & XSLT for school. They told us to choose a topic ourselves, so what better could I write about then this :).The best thing to do is probably to explain the XSLT process in detail and then go to XSL(-FO).In XSLT, an XML file is taken by an appication, called an "XSLT processor" as input. Using the XSLT elements, this XML document is turned into another XML based document (be it XHTML, SVG, RSS, WML, another custom XML, etc.), or plain text output. The next application (most oftenly: the browser) takes that code as input and visualises it to the user.(When you tell that to the class, be sure to say it slowly, with jestures and drawings if needed.)An XSL-FO document is not passed to a browser however (not yet anyway, scince none support it). Instead, another application, called a "FO processor" takes this input and turns it into another visualisable document and/or shows it to the user at that moment.Now, where is the difference between the two you ask? Let's follow the process:In XSLT:

XML	\XSLT - -> XSLT processor ---  XHTML/SVG/RSS/text/whatever-------->| BROWSER or another appication |

And in XSL-FO:

XSL-FO ----> FO processor --- PDF/PostScript/??? ---> | A proper viewer or application |

Now look closely. What's missing? YES! XSL-FO didn't took an XML as input. Instead, it's a form of output a visualising application can project directly. However, most of today's viewers won't read XSL-FO documents on the fly. Instead, they would rely on another application (the FO processor) to turn it into a form they can read. Think of it as "markup to document" language.Taking the above note and shemes, you can easily understand how those two languages can work together, taking a common XML as a data source:

XML	\XSLT - -> XSLT processor ---  XSL-FO --------> FO Processor ----- PDF/PostScript/???--->| A proper viewer or application |

And scince you can have more then one XSLT, you can make one for each version of a type of XML. For example one for converting yourXML-to-FO, another for yourXML-to-XHTML, etc.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...