[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 
Messages posted by: Victor Krapivin
Forum Index » Profile for Victor Krapivin » Messages posted by Victor Krapivin
Author Message
Thank you informing us about this fight.

Hopefully, XSLfast have support of relative static images, and you can use it in several ways.

But to let it run, you need to understand what is "relative path" in this case. For FOP, relative path is counted against either system id (XSLfast does not adds it into XSL style sheet) or against current folder. While XSLfast runs, "current" folder is <XSLfast installation>/bin folder, but not folder with XSL. Unfortunately, this is FOP limitation so only File/Export menu generates XSL files without relation to this folder.

So, once you know this fact, you can use paths as you need:

a) place new image from tool bar.
b) At inspector window (left-bottom corner) switch it to static.
c) By click on image (or by inspector again) you'll see file choose dialog for images.
d) Select image you need.
e) In inspector, you'll see absolute paths. You can ignore this - while XSLfast generates XSL it automatically converts absolute paths to relative.
f) If you need other relative path - just clck on path and in edit field correct path as you need.

For static images, usually you don't need base paths; base paths are added mainly to dynamic images.

But you can use base path here and specify only image name if you prefer this. For static image, real path is counted as two pieces: base path and path to image itself. If base path is empty, XSLfast uses only image path.

Concerning Google Chrome, we're sorry but XSLfast accepts drag and drop only from XSLfast. I've added JIRA issue: http://jira.jcatalog.com/browse/XSL-1536 so in next version we'll see if we can improve this behavior.

Note: Since XSLfast 4.0.1, you can use http://... links to images in XSLfast, and drop images at work area from browser or file explorer.
When selecting your XSD file, please select the option "[x] do not bind to top node".

In this case XSLfast will not try to find the first root element and you are able to work with all root elements at the same time.
We're sorry but XSLfast 4.0 has no support for this region type.

We will check, if we can add this option in one of the next minor releases.

I have created a ticket for your requirement:
http://jira.jcatalog.com/browse/XSL-1533

In the meantime, multi layouts provide an alternative in some situations.
You could define a different layout for the last page in a multi layout.
However, we see that this not the general solution.
Anonymous wrote:With fop 0.95 it's possible renders PDF 1/A with -pdfprofile PDF/A-1b parameter in the command-line, or "pdf-a-mode" parameter.
How it's possible with XSLfast 4.0?
Thanks in advance.


Just specify [x] embed all fonts, including base14 option in Extras/preferences.

PDF profiles are unavailable in XSLfast now, sorry.

I have created a ticket for your requirement: http://jira.jcatalog.com/browse/XSL-1531.
Anonymous wrote:Hello,

I evaluate the product XslFast 4.0 and i have a few questions about it :

I have a document development cycle like this :
a/ I produce a XML Schema defining XML datasets.
b/ I need to produce a layout based on XML Schema.
c/ I need to test my layout with a sample XML dataset.

Is this development cycle possible with XSLFast ? If it's possible, how do I specify a runtime XML file to render the layout ?

Finally, I want to use XML Schema only to produce the layout. My XML Schema contains several global element. How do I specify the root element to XMLFast.

My version is XSLFast-4.0-2009-07-30.

Regards.


We're sorry but you can't currently use XSD and XML in parallel; we could realize this feature in a future version, if you are interested.

I have created a ticket for your requirement:
http://jira.jcatalog.com/browse/XSL-1534

Right now, you need to switch the data source when you want to see the preview.

You do this in the following way:
- go to the file menue
- click on "load structure from xml file"
- select your xml file
- create the preview

Or just use the XSL export in XSLfast and call your XSLT (saxon for example) and XSL-FO render (like FOP or XEP or XSLFormatter).

Note: Since XSLfast 4.0.1, you can specify sample XML file in case you've using XSD or DTD. To do this, please use Preview -> Layout settings -> Advanced tab.
What is MultiLayout Manager

MultiLayout Manager is really old thing: it provides a way to combine many separate layouts to one XSL.

It has the following important limitations:

  • all layouts needs to use the same XML (XSD, DTD) structure.
  • all layouts should use the same page sizes, region sizes and the same page margins.
  • if certain region attached, it should be completed (both even/odd or first/rest).


What are page sequences

To understand how MultiLayout Manager works, please take tour on tutorial files from examples 7, 8 and 9. It made in both forms - for usual case and for MultiLayout Manager.

For example, while we opening example 9 (without _old suffix), we can see two page sequences defined in layout:

  • master page sequence
  • main page sequence, with odd and even regions.

Of course, you can use as much page sequences in layout as you need, and every page sequence able to use the separate regions (either even/odd type, or first/last/rest).

How to make the same in MultiLayout Manager?

In the same manner, to make the same result in MultiLayout Manager, you need also configure two page sequences (by typing separate group names for every page sequence). And in range of certain group, if you have more than one layout, you can specify if certain file is main ([x] body) or region ([x] header/footer). For region, you can specify its' type and exact position.

So, in MultiLayout manager you can combine layouts directly at the time it is necessary, without copying layout contents to your main layout file.
Of course, you need to make layout fast,. But XSLfast has a lot of abilities - which one is the fastest?

Here we collected few most important tricks that helps you use XSLfast fast and error-proof.

  • Tool bar has only few operations most often used. Use context menus to see more actions available.

  • Use inspection window if you need to know all possible options for selected element(s).

  • Use drag and drop every time you need to type something. For almost all cases it works.

  • Please note amount of options is sensitive to render engine you selected and other options. For example, exact positioning of elements is applicable only if absolute placement is selected. The absolute/relative placement is available only if you have fo:block/fo:container options turned on, etc.

  • While creating new layout, try use existing template first.

  • Leverage amount of elements on page. Less elements on page - faster creation. To do this, you have two composite and really big elements. There are texts and tables.

  • Text element hints.


    • Keep in mind, you can combine multiple static texts and variables from XML directly in one text element. You don't need to make mosaic.

    • To place variable, you can simply drop it into editor area.

    • Every variable in text area can be represented as link, date/time, formatted numbers, and so. Use context menus to specify correct type of elements (Convert) and settings (Properties).

    • To type variable inside text by hands, just around your text into figure brackets.

    • If you need single selection from certain elements like "if A then B else C"), place choose element from palette of elements on the right, and incorporate your clauses inside. You don't need to make custom XSL code here.

    • If you need such highlighting of variables depending of its' values, please use conditional attributes from context menu, and table at the bottom of text area.

    • The typical appliance of text element is displayed at first example, please take a look on it and know it is good practice.

  • Table tricks.


    • The fastest way to make table - just use wizard from first to last step. Here you'll able to specify table size, table summaries in different forms, and table content. Just few clicks and you don't need to type many complex XPath expressions.

    • Of course the simplest way to fill table - use drag and drop from structure tree.

    • With context menu and tool bar, you can manage your table, add/remove columns, tables, sub-filters, and more.

    • If you need to enumerate such hierarchy like ProductGroup/Product, you don't need to make two tables and combine it. One table is enough. Just specify filter/break level for such rows you need for inner Product elements.

    • If you need master/detail tables, use appropriate wizard from context menu; it will make you slave table and embeds into master table as template, with correct filters.

    • If you need such analytic like counts, summaries, etc you don't need to make it manually. use context menu for certain column.

    • Of course, all options are collected at left-bottom inspection window.

    • If you need, you can place several elements into one table cell.

  • Border tricks

    • you can specify border for table cell and for inner cell elements separately.

    • use context menu to specify correct borders for whole table cells.

  • For really complex layouts and reports, or for case your data is not well-formed in hierarchy, you can use pivot tables or filtering by content for usual tables. Pivot tables are good things, but whole content is dynamically created. So, if you need fixed columns, use filtering by content for usual tables instead.

  • If you have good pivot table and need to format it more than XSLfast provides, convert it to usual table via one click from context menu. You'll lose dynamic columns, but you'll can manage every cell as you wish.

  • use multiple elements selection if you need to specify colors, borders, and so on.

  • use conversions from one element types to another; all XPath expressions will be kept and reassigned depending on type. XSLfast also able to convert known XSL code to XSLfast elements!

  • In case you need complex XPath expression - use XPath Monitor to evaluate it.

Hope these hints will help you making layouts much faster.



We have support of MacOS X. You just need to use JAR installation, Java 1.6, and PDF reader.

Contact our sales to obtain trial version.

Unfortunately, contrary to Windows version, you might need more clicks to start working.

First, JAR installer will not configure XSLfast properties on the fly, so you SHOULD need follow to Extras/Preferences dialog and specify PDF reader, external browser, and other system-specific things (once XSLfast generated font metrics for you at first start).

Second, amount of fonts can be limited to known for Java.

Third, XSLfast will looks like legacy application, it does not integrated with top menu as other Mac applications. To looks like Mac OS X applications, please choose relevant look and feel - Substance or native Apple look.

Lastly, XSLfast will collect all files in your home folder, not in /Library or /Applications.
Once you clicking text editor, you'll see a lot of elements, a lot of menus, a lot of buttons, and sometimes it is not so easy to find how to use this. Hope this article helps you.

Often, we have questions:

Please provide me the detailed description and simple examples of how to use these functions, in XSLfast, available under:

  • Node Set
  • String
  • Boolean
  • Number
  • Date/Time
  • Math
  • Today


There are XPath functions grouped by categories. It are necessary for case you need to operate not with full string for example but with its' length. To use necessary functions from menu instead of typing, you can

- select such expression within variable
- click string -> string-length

and voila! your selected fragment is arranged by proper function call.

To let it more understandable, I need to explain a bit the background of the text itself and text editor in particular.

The text element is an composite; it able to contain many pieces at once. There are

- static texts
- variables from originating XML (XSD, DTD).

So, the typical text content is

-------------------------------------------
First Name: {/Report/Order/FirstName}
Last Name: {/Report/Order/LastName}
Address: {/Report/Order/Address1} {/Report/Order/Address2}
Email: {/Report/Order/Email}
-------------------------------------------

This is an one element with static strings (at the left of each row) and with couple of variables (every variable is arranged by figure brackets). To type variable, you can either drag such node from XML tree at the left and drop it to position you need, or simply type such text with figure brackets.

Of course, such time you need to format variable's contents as links, dates, numbers, or so. To do this, you can use context menu at variable, "Convert" sub-menu item, and select proper view you need. In the same manner, via context menu, you can launch inspector window for variable and specify options here ("Properties".

Or, if you need, you can use tool bar area at the right (see icons). By clicking on that icons you can place variables with correct text and with surrounding properties. The usage as usual: select such text, click on icon, and you'll convert it into variable and with correct type.

The correct usage you can see at example 01_SimpleFlyer.
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.
 
Forum Index » Profile for Victor Krapivin » Messages posted by Victor Krapivin
Go to:   
Powered by JForum 2.1.8 © JForum Team