[Logo] Forums for GrailsFlow, Weceem, XSLfast
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
XSLfast basics: what is XSLfast?  XML
Forum Index » XSLfast Forum
Author Message
Victor Krapivin



Joined: 04/06/2009 10:12:44
Messages: 54
Online

Terms

XSL is W3C standard of style descriptions, named eXtensible Stylesheet Language. It is programming language describes how to process input XML file and convert it into specific documents like XSL-FO or HTML. So, XSLfast generates XSL file to apply it to your documents collected into XML format.

XSL-FO is W3C standard of printable documents. It describes how text, images and more should be arranged on pages. This standard is created as an alternative to proprietary PDF or PS. And of course it can be converted to PDF, via different tools named render engines. XSLfast supports the following render engines:

- FOP (xml.apache.org), both old version 0.20.5 and new 0.95. There are open source projects so it has this version naming.
- XEP (RenderX commercial product, should be installed separately)
- XSLFormatter (AntennaHouse commercial product, should be installed separately)

XSL is stylesheet (e.g. style file to apply it to XML document). Appliance of XSL to XML documents is named 'XSL transformation', or briefly 'XSLT'.

FOP is conversion tool that produces PDF from XSL-FO, as well as XSLFormatter. The conversion process is named 'rendering', so this is reason why FOP etc is named as 'render engine'.

XPath is an expression standardm describes how to operate with XML contents. The simplest XML expressions are described in 'Creation layout' section below.

Appliance

XSLfast is an specific tool: it produces not PDF output, but templates that can be used later in 3rd party cycle. This is style editor. So, via XSLfast you can create style (named layout), and export it into XSL file for future usage.

Appliance of XSLfast and its' results can be divided to two phases:

1. Creation of layout (style)
2. Appliance of this layout for actual data.

It is simple principle "write once - use many".

At time you creating template, you creating XSL file (style) that can be applied to all of your XML documents with the same (or similar) structure later. In few words, XSLfast helping you make specific style, describes how to print your documents, but does not produce any output directly. So, XSLfast is like to developer' tool - it makes content that should be used later in 3rd party way.

Once you created style, you can apply it to see how formatting going. To do this, you can either use XSLfast and its' preview option, or let do this by other tools like XSLfast Print Server.

In diagrams, it can be displayed as

a) Design time: creation of style



b) Run-time: Printing



XSL-FO document can be either used directly, or can be converted to various formats like PDF, RTF or whatsoever. The PDF us most commonly used here, like the following:



This way also incorporated into XSLfast, but only for preview purpose, not for final PDF creation.

As result, this way provides you unique possibility - you need to create style only once, but using this style you can print thousands of documents (catalogs, invoices, and anything you need).

Creation of layout

First, we creating an layout once. At this time, you have not final XML document to operate, but just structure of this document. It can be sample XML file, or DTD or XSD files, describes structure of your documents completely.

Visually, you creating detailed description how certain data from your XML documents should be printed - into frames, into tables, etc. To do this, you've using specific tools of XSLfast, named filters (or groupings). In simple sense, groupings means how to enumerate contents of XML, from specific node or expression.

So, if we have simple XML file named Demo.XML (see XSLfast installation contents), we can enumerate all product groups (by expression /Report/Productgroup), or all products (/Report/Productgroup/Product), or both. The simple creation of certain table with filter expression /Report/Productgroup/Product means we need to fill table with contents of all products. By defining leafs Name, Description, etc in appropriate table cells, and specifying it view type (text, image, etc), you provides content view for every product.

This is important issue: as you working not with data but with structure, you need to keep in mind this fact all time you working with layout. Fortunately, XSLfast helps you to do this, via drag and drop, context menus, tool bars, and inspector window.

Context menus contain rich set of most popular options and actions, but not all possible cases.

Tool bars contains only few most popular actions, for newbies who works with XSLfast rarely. Ot contain only few possible options to manage, to let user concentrate with layout creation.

Inspector window (left-bottom corner) contains all possible options for specific case; this is most powerful and rich place to manage everything. This window has only possible options applicable for currently selected element(s). For example, old FOP has no orientation support for texts; so if you've selected FOP 0.20.5, you'll not see appropriate options anywhere as it are not applicable. But simple switching to more recent FOP 0.95 will add it for you, so keep in mind XSLfast has many sensitive options to other ones.

Printing

Once XSLfast produced style for you, you either can see results in preview mode, or collect it to further usage.

For preview, XSLfast creates styles automatically, generates XSL-FO document for sample XML you attached, and invokes render engine you selected to produce PDF from XSL-FO document as well. Finally, XSLfast can call PDF Reader for you, to see what's generated.

But for case you need to use style at your own process, you need to generate both XSL-FO and PDF files in your way.

For example, you can do the following steps as much time as you need, with one XSL style produced by XSLfast:

- extract XML document somewhere, for example from database
- with help of XSL style produced by XSLfast, and using Saxon (XSLTproc, MSXML SDK, etc) tool, you can produce XSL-FO document
- with help of FOP (XEP, XSLFormatter or other 3rd party tool) you can produce PDF and send it to your clients.

As you see, XSLfast automates only first half of whole process cycle; it helps you creating styles.

This message was edited 2 times. Last update was at 26/08/2009 09:50:26


Best regards,
Victor Krapivin
[WWW]
 
Forum Index » XSLfast Forum
Go to:   
Powered by JForum 2.1.8 © JForum Team