58
Overview FOA tutorial Attribute Sets (XSL) XSLT File XSLT Processor XSL-FO File 1..n Pages Page Sequences Bricks Content Sequences XML File 1..n Variable Sets (XSL) 1..n

Overview

Embed Size (px)

DESCRIPTION

FOA tutorial. Overview. Page Sequences. Attribute Sets (XSL). XML File. 1..n. 1..n. Pages. Variable Sets (XSL). 1..n. Bricks. FOA. XSLT File. Content Sequences. XSLT Processor. XSL-FO File. FOA tutorial. Start a new Project. 1. - PowerPoint PPT Presentation

Citation preview

Page 1: Overview

OverviewOverviewFOA tutorial Attribute Sets

(XSL)

XSLT File

XSLT Processor XSL-FO File

1..n1..n

PagesPages

Page SequencesPage Sequences

BricksBricks

Content SequencesContent Sequences

XML File

1..n1..n

Variable Sets(XSL)

1..n1..n

Page 2: Overview

Start a new ProjectStart a new ProjectFOA tutorial

1

2

22

1 Click New Project or select New Project from the Project Menu

2 FOA initialises Page Manager, Page Sequence Manager and Brick Manager

Page 3: Overview

Create a new Page (1)Create a new Page (1)FOA tutorial

1

23

4

5

1 Left Click on Pages, Right Click and select New Page…

2 FOA opens Page Properties Dialog

Select a page format or insert the page dimensions3Select Margin tab if you want specify margins4Insert margin dimensions5

Page 4: Overview

Create/Modify a Page RegionCreate/Modify a Page RegionFOA tutorial

1

2

3

4

1 Left Click on a Page Region (e.g. Body), Right Click and select New Region…

2 From the Page Region Selection Dialog select a Region

From the Region Properties Dialog, insert the Region Extension

3

It is possible to specify all related properties (e.g. Borders)4

Page 5: Overview

Create a New Page Sequence (1)Create a New Page Sequence (1)FOA tutorial

1

2

3

1 Left Click on Page Sequences, Right Click and select New Page Sequence…

2 From the Page Sequence Selection Dialog select a type of Page Sequence. FOA allows:• single (an unrepeatable page)• repeated (a repeated page with optional first and/or last page)• alternating (odd and even pages and/or a first and/or a last) Assign to every specific positions a page among the available ones

3

Page 6: Overview

Create a New Page Sequence (2)Create a New Page Sequence (2)FOA tutorial

Once the page sequence has been created, it is added to the Content Sequence Manager as well as every kind of region composing the pages of the sequence

The statementLetter sequence is an unbounded repeated sequence of the page letter without a first and last page.

1

21

2

Note: according to XSL-FO specs: header = before, footer = after, left = start, right = end (relative to the body or document flow).

Note: according to XSL-FO specs: header = before, footer = after, left = start, right = end (relative to the body or document flow).

Page 7: Overview

Open an XML content fileOpen an XML content fileFOA tutorial

1

2

3

1 Click Open button from XML Content Manager

2 From the file chooser you can select the amount of content that you want to load from XML file.This can be useful when you have very large XML files.

Once opened, you have a tree representation of your XML file

3

Page 8: Overview

Attribute Sets: CreationAttribute Sets: CreationFOA tutorial1 New Attrib. File, select a class of

attrib. and then select New Attrib. Set2 The “class” Properties dialog allows

you to specify properties. According to XSL-FO Specs you have common and specific properties.

On the left tab panel you can select the property group

3

1

2

3

44 The saved set shows all its properties

Page 9: Overview

Attribute Sets: Add/ModifyAttribute Sets: Add/ModifyFOA tutorial1 Select the Attribute Set class and then

an Attribute Set2 When you choose to add and modify

an Attribute Set, the “class” Property dialog shows the previous set properties with a (*) symbolYou can modify these values or change the values of new properties adding them to the Attribute Set

3

1

2

3

Page 10: Overview

Attribute Sets: VariantsAttribute Sets: VariantsFOA tutorial

2

1

3

1 Select New Variant of Attribute Set to create a new variant

2 The “class” Property dialog shows the SpecialText properties with a (*) symbol

When you update your variant, only the different properties and values are added to the variant. So when you style a text block with SpecialText1 you will use all the SpecialText properties ( ) and add/override them to the SpecialText1 ones.

3

Page 11: Overview

Attribute Sets: Export to CSS 2Attribute Sets: Export to CSS 2FOA tutorial1 1 Export the Attributes in a CSS2 file

Page 12: Overview

Adding content to a SequenceAdding content to a SequenceFOA tutorial

2

3

1 Change Content Reference button allows you to select a tag from the XML content file.

2 Once selected, you can choose that particular occurrence or all those kinds of tags

In the Content Sequence Manager it is now possible to see the selected content.

3

Note: in this case the order is important, because it affects the flow content order into the XSL-FO document

Note: in this case the order is important, because it affects the flow content order into the XSL-FO document

1

Page 13: Overview

Update Content Sequence PropertiesUpdate Content Sequence PropertiesFOA tutorial

1 From the Content Sequence Manger right click on the Content Sequence and select to update the properties

2 These properties are related to the page numbering. You can select the initial page number and force the page counting.

This second set of properties is related to the page number formatting, see the Page Number Brick for more details

3

1

2

3

Page 14: Overview

<xsl:template match="" foa:name="" foa:class="" foa:group=“” foa:type=“”>

<fo:element foa:name="" xsl:use-attribute-sets="">

<xsl:apply-templates [select=""]/>

or

<xsl:value-of select=""/>

</fo:element>

</xsl:template>

<xsl:template match="" foa:name="" foa:class="" foa:group=“” foa:type=“”>

<fo:element foa:name="" xsl:use-attribute-sets="">

<xsl:apply-templates [select=""]/>

or

<xsl:value-of select=""/>

</fo:element>

</xsl:template>

Bricks: Fundamentals (1)Bricks: Fundamentals (1)FOA tutorial

Simple Brick

Complex Brick

Simple Brick Simple Brick

Simple Brick

Simple Brick

1 The basic XSL transformational element in FOA is called Brick. A Brick is usually composed of some information:• name: identifies the Brick (univoque)• class: identifies the kind of FO class it is related to (e.g. block level, inline level)• group: identifies the Brick element (e.g. paragraph, emphasis, image …)• type: identifies the Brick part of the group (it will be the same if it is a Simple Brick)

2 A complex Brick can be achieved composing two or more simple Bricks.Every simple Brick must have the basic information, but can have different FO elements. A complex Brick can be a List, formed by the following simple Bricks: the List Brick, the Item Brick, the Label Brick and the Body Brick.

1

2

Page 15: Overview

Bricks: Fundamentals (2)Bricks: Fundamentals (2)FOA tutorial<xsl:template match="" foa:name="" foa:class=""

foa:group=“” foa:type=“”>

<fo:block foa:name="" xsl:use-attribute-sets="">

<xsl:apply-templates [select=""]/>

or

<xsl:value-of select=""/>

</fo:block>

</xsl:template>

<xsl:template match="" foa:name="" foa:class=""

foa:group=“” foa:type=“”>

<fo:block foa:name="" xsl:use-attribute-sets="">

<xsl:apply-templates [select=""]/>

or

<xsl:value-of select=""/>

</fo:block>

</xsl:template>

1

2

3

4

1 The Brick Dialog allows you to insert all required info.

2 The Match field gives the opportunity to set the Brick entry point into the XML content (XSL-T match)Select a tag from the XML and the match will be automatically updated

3

Class, group and type are automatically chosen when you select the Brick element (e.g. paragraph)

4

Page 16: Overview

Bricks: Fundamentals (3)Bricks: Fundamentals (3)FOA tutorial<xsl:template match="" foa:name="" foa:class=""

foa:group=“” foa:type=“”>

<fo:block foa:name="" xsl:use-attribute-sets="">

<xsl:apply-templates [select=""]/>

or

<xsl:value-of select=""/>

</fo:block>

</xsl:template>

<xsl:template match="" foa:name="" foa:class="" foa:group=“” foa:type=“”>

<fo:block foa:name="" xsl:use-attribute-sets="">

<xsl:apply-templates [select=""]/>

or

<xsl:value-of select=""/>

</fo:block>

</xsl:template>

1

1

43

1 Select a style among the defined ones. You will able to select a style among all the defined styles inside the Brick class

2 The default situation for the Brick is to have content inside the element.

If your content is outside the element, you can specify a new tag (also in a different XML file) from which the content will be taken

3

4

2

If the content is inside an attribute, you can select it

Page 17: Overview

Bricks: Matching (pattern path)Bricks: Matching (pattern path)FOA tutorial

1 Full path selection: all the elements inside the match pattern /doc/section/chapt/par

4

1

2

3

1 2 3 4

2 Mid tag path selection: all the elements inside the match pattern //section/chapt/par

3 Mid tag path selection: all the elements inside the match pattern //chapt/par

4 Leaf tag path selection: all the elements inside the match pattern //par

Page 18: Overview

Bricks: Matching (position constr.)Bricks: Matching (position constr.)FOA tutorial

1 2

1 Match all the elements, as expressed into the pattern path, which are second.

2 Match all the elements, without any pattern path, which are second

Note: the position constraint can be used in combination with all possible slider entriesNote: the position constraint can be used in combination with all possible slider entries

1

2

Page 19: Overview

Bricks: Matching (attributes constr.)Bricks: Matching (attributes constr.)FOA tutorial

1

2 1

2

1 Match all the elements, as expressed into the pattern path, which have the attribute id=‘1’2

Note: the attribute constraint can be used in combination with all the possible entries of the sliderNote: the attribute constraint can be used in combination with all the possible entries of the slider

Page 20: Overview

Bricks: Cont. Sel. (outside tag)Bricks: Cont. Sel. (outside tag)FOA tutorial 1 Set the Brick match

2If the content is not inside the matching tag, select “content outside”Select the content tag from an XML file

3

1

2

3

4

4 The sel. process works like the match one, except that you can express pos. constr on all the tags present in the tree path

Page 21: Overview

Bricks: Cont. Sel. (inside attribute)Bricks: Cont. Sel. (inside attribute)FOA tutorial

1

2

3

4

1 Set the Brick match

2 If the content is inside one of the matching tag attributes, select “content inside match tag attribute”Select the tag from the XML (it must be the same of the matching)

3

4 Tick the attribute in which there is the requested content

Page 22: Overview

Inspect Brick matching against XMLInspect Brick matching against XMLFOA tutorial

1

2

1 Click on the Content Matching Finder Icon

2 Using the “right” click on a matched element (in black) the corresponding brick name and group will be highlighted

Page 23: Overview

Paragraph and Emphasis BricksParagraph and Emphasis BricksFOA tutorial1

23

4

5

1 Brick name field

2 Matching button

3 Style selector

4

5

Outside Match tag content selector button

Match tag attribute content selector button

Note: the Emphasis Brick has the same GUI

Note: the Emphasis Brick has the same GUI

Page 24: Overview

Page Number BrickPage Number BrickFOA tutorial

1

2

3

1 Define the Page Number Brick like an Emphasis Brick

2 Edit the Content Sequence Properties

3 Format the page numbering style Note: these properties are related only to the page numbering style.For other style info refer to the Inline class

Note: these properties are related only to the page numbering style.For other style info refer to the Inline class

Page 25: Overview

Image and Ext/Int Link BricksImage and Ext/Int Link BricksFOA tutorial

1 The same as Paragraph Brick

2

3 Attribute Content selection button: it allows you to select the content of an attribute of the XML matching tag which points at the image or at external link href or at internal id ref.

4 5

Note: the External and Internal Link Bricks have the same GUINote: the External and Internal Link Bricks have the same GUI

1

2

3

4

5

6

6

e.g.: Imagee.g.: Image

e.g.: Internal Linke.g.: Internal Link

e.g.: External Linke.g.: External Link

Page 26: Overview

Ordered List BrickOrdered List BrickFOA tutorial

XML Generic ModelXML Generic Model

1

2

3

4

5

6

7

1 Match tag to the entire list

2

3

4

5

6

Format of the numbering (eg 1, I)

Match tag to the list item element

Item style (class=“block”)

Select content outside item elementList style (class=“list”)

8

Page 27: Overview

Unordered List BrickUnordered List BrickFOA tutorial

XML Generic ModelXML Generic Model

1

2

3

4

5

6

7

8

1 Match tag to the entire list

2

3

4

5

6

Label type (it can be selected from an attribute field of the XML: WH2FO compatibility)Match tag to the list item element

Item style (class=“block”)

Select content outside item elementList style (class=“list”)

Page 28: Overview

Label & Body List BrickLabel & Body List BrickFOA tutorial XML Generic

ModelXML Generic Model

1

2

3

4

5

6

7

1

2

3

Match tag to the entire list

4

5

Note: the Brick Content tab is the same of the Ord/Unordered ListNote: the Brick Content tab is the same of the Ord/Unordered List

6

7

Match tag to the label list element

Label style (class=“block”)

Body style (class=“block”)

Match tag to the body list element

Select content outside label element

Select content outside body element

Page 29: Overview

Item, Label & Body List BrickItem, Label & Body List BrickFOA tutorial

Note: the Brick Content tab is the same of the Ord/Unordered List and Label and Body work like they do in Label&Body List

Note: the Brick Content tab is the same of the Ord/Unordered List and Label and Body work like they do in Label&Body List

XML Generic ModelXML Generic Model

1

2

3

Match tag to the entire list

4

5

6

7

Match tag to the list item element

Item style (class=“block”)

Match tag to the body list element

Label style (class=“block”)

Match tag to the label list element

Body style (class=“block”)

1

2

3

4

5

6

7

Page 30: Overview

Simple TableSimple TableFOA tutorial

1

2

3

General table description

4

Columns management

Rows management

Cell management

1

2

3

4

Page 31: Overview

Simple Table: ColumnsSimple Table: ColumnsFOA tutorial

1

2

3

Insert a column before the selected one

4

Insert a column after the selected one

Delete a column

Edit the column width

1 2 3 4

Note: the columns order (inside this list) is important because it will reflect the real table column widths.

Note: the columns order (inside this list) is important because it will reflect the real table column widths.

Page 32: Overview

Simple Table: RowsSimple Table: RowsFOA tutorial

1 2 3 4

1

2

3

Insert a row before the selected one

4

Insert a row after the selected one

Delete a row

Edit the row brick Note: the rows order (inside this list) is NOT important because it will be established by the matching rule and the XML content

Note: the rows order (inside this list) is NOT important because it will be established by the matching rule and the XML content

Page 33: Overview

Simple Table: CellsSimple Table: CellsFOA tutorial

Note: the cells order (inside this list) is NOT important because it will be established by the matching rule and the XML content

Note: the cells order (inside this list) is NOT important because it will be established by the matching rule and the XML content

1 2 3 4

1

2

3

Insert a cell before the selected one

4

Insert a cell after the selected one

Delete a cell

Edit the cell brick

Page 34: Overview

Complex TableComplex TableFOA tutorial

1

2

3

General table description

Columns management

Style and content selection

1

2

3

Page 35: Overview

Complex Table: BodyComplex Table: BodyFOA tutorial

1

2

3

Add Header Button

Modify Body Button

Add Footer Button

1

2

3

Note: Table Body, Header and Footer are similar to the Simple Table Brick, without the column description.

Note: Table Body, Header and Footer are similar to the Simple Table Brick, without the column description.

Note: Before Editing and creating Body, Header and Footer give a name to the Complex Brick

Note: Before Editing and creating Body, Header and Footer give a name to the Complex Brick

Page 36: Overview

Complex Table: Header/FooterComplex Table: Header/FooterFOA tutorial

1

2

3

1

2

3

Select Add Header

Set all the Table Header parameters

After the update you can modify the newly created sub-Brick or delete it

Page 37: Overview

Global Settings: set-up and loadGlobal Settings: set-up and loadFOA tutorial

12

3

45

1

2

3

From Render menu select an external XSL-FO viewer to invoke

4

5

Write the command line or browse

Select the application

Windows users there is one on the settings dir (see installation)

You can load a config.foa file that contains all the global settings.

Page 38: Overview

Variable Set Manager: ParametersVariable Set Manager: ParametersFOA tutorial

1

2

3

Create a new XSL-T parameter

4

Assign a name to the parameter

Modify the parameter name

Delete the parameter

1 2

3

4

Page 39: Overview

Variable Set Manager: VariablesVariable Set Manager: VariablesFOA tutorial

1

2

3

Create a new XSL-T variable

4

Modify an existing XSL-T variable

Set the variable name

Assign the variable value- select option uses the select construct to assign the value to the variable- content definition uses the content inside the tag option to assign the value to the variable

1

2

3

4

Page 40: Overview

Variables: How to use them (1)Variables: How to use them (1)FOA tutorial

1

2

1

2

Match the “static” content on the document model

Select the “variable” content from one of the document instance value sets

Page 41: Overview

Variables: How to use them (2)Variables: How to use them (2)FOA tutorial

3

3

4

5

Select the content path

6

Choose one element in the path to make variable

Select if you want to replace it with a variable or just insert a variable before

Select the variable you want to insert or replace

4 5

6

Page 42: Overview

Variables: How to use them (3)Variables: How to use them (3)FOA tutorial

7

8

Select one of the defined variables

Apply the changes. Now the content value is dependent on what is the value of the variable customerFile

7

8

Page 43: Overview

Generate XSL-FO: create makefileGenerate XSL-FO: create makefileFOA tutorial

1

2

Generate FO command will open the XSL-T Processing dialog that uses makefilesSet the various parameters to execute the XSL-T processing

1

2

3

4

3

4

If the project has an external parameter set its value or file reference

Save the makefile (.mk) relative to the project IMPORTANT: remember to save the

project before creating the FO file. Only saving the project you write/modify the XSL-T file

IMPORTANT: remember to save the project before creating the FO file. Only saving the project you write/modify the XSL-T file

5

5 Execute the XSL-T processing

Page 44: Overview

Generate XSL-FO: open makefileGenerate XSL-FO: open makefileFOA tutorial

1

2

1

2

Generate FO command will open the XSL-T Processing dialog that uses makefilesLoad the makefile (.mk) relative to the project

3 Execute the XSL-T processing

3

Page 45: Overview

Rendering into PDFRendering into PDFFOA tutorial

1

2

3

2

1

2

Render Document command will open the PDF Rendering dialog that uses makefilesLoad the makefile (.mk) relative to the project

IMPORTANT: the makefile contains both the information for the XSL-T processing and the Rendering. So to complete the setting you need to save it, on the same file for both operations

IMPORTANT: the makefile contains both the information for the XSL-T processing and the Rendering. So to complete the setting you need to save it, on the same file for both operations

Page 46: Overview

Preview: GenerationPreview: GenerationFOA tutorial

1 Load/Set the makefile and select “Generate Preview”

Close the window3

2 Press the run button to start the XSL-T process

1 2

3

Note: the preview information are generate using a customized version of FOP (based on 0.20.5) that is inside the FOA distribution package

Note: the preview information are generate using a customized version of FOP (based on 0.20.5) that is inside the FOA distribution package

4

4 The Rendering for Pre-view will be automatically opened, press Run then Ok.

IMPORTANT: remember to save the project before generating the preview. Only saving the project you write/modify the XSL-T file

IMPORTANT: remember to save the project before generating the preview. Only saving the project you write/modify the XSL-T file

Page 47: Overview

Preview: DocumentPreview: DocumentFOA tutorial

1 Menu bar for document browsing and zooming

XML rendered doc:This is the document preview, it’s based on an XML description of the rendered areas

3

2 Logic Tree:this tree represent the current page inside the sequence with all the regions and the brick composing them

1

2

3

Page 48: Overview

Preview: Document browsingPreview: Document browsingFOA tutorial

1 Browsing controls: first page, previous page, next page, last page.

2

3

4

Page jump field: get the requested page number and goes for it.

Fit to page: enlarge or reduce the document preview side to fit the entire page in the current window dimension.

Zoom control: specify the zooming factor (in and out)

1 2 3 4 5

5 Re-generate button: if you made some variations to the Bricks you can see the results

Page 49: Overview

Preview: Brick highlightingPreview: Brick highlightingFOA tutorial

1 Select a Brick from the Logic Tree:

2 The corresponding area will be highlighted inside the rendered document

12

BrickName[class][instance]

Note: changing the one Brick instance will affect all the other instances

Note: changing the one Brick instance will affect all the other instances

Page 50: Overview

Preview: Brick variationsPreview: Brick variationsFOA tutorial

1 Select a Brick from the Logic Tree and select the Modify Brick option

2 FOA will open the corresponding Brick dialog and will allow you to modify it.1

2

Page 51: Overview

Preview: Attribute variationsPreview: Attribute variationsFOA tutorial

1 Select a Brick from the Logic Tree and select the Modify Brick Attributes option

2 FOA will open the corresponding Attribute Set.(e.g.: change the font colour to red)

Page 52: Overview

Preview: Re-generation (1)Preview: Re-generation (1)FOA tutorial

1

23

1

2

3

Press the re-generation button

Press the run button to start the generation process

When the process is ended and you get the “RENDERING SUCCESSFUL” message, press the ok button and see your changes applied to the document

IMPORTANT: remember to save the project before generating the preview. Only saving the project you write/modify the XSL-T file

IMPORTANT: remember to save the project before generating the preview. Only saving the project you write/modify the XSL-T file

Page 53: Overview

Preview: Re-generation (2)Preview: Re-generation (2)FOA tutorial

1

1 Now you can see that the font colour for the Brick “Account Number” has been changed to red

Page 54: Overview

Export: Web version in HTML (1)Export: Web version in HTML (1)FOA tutorial

12

3

4

5

1 Invoke the Export Wizard

Select/Deselect to export the foa attributes (requires foa namespace)

3

2 Set the Wizard Profile Name, this will be reflected in the XSL-T file name

4 Select the exporting mark-up language, in this case HTML

5 Select the desired page sequence to export among the available ones

Page 55: Overview

Export: Web version in HTML (2)Export: Web version in HTML (2)FOA tutorial

1

2

3

4

1 Select one page model among the available ones

Press Finish3

2 Set the attributes format for the HTML document (only CSS2 currently available)

4 Two new XSL-T files are automatically generated:-…_Web_index: main XSL-T for Web Profile-…_HTML_Common: common templates for

HTML based exports

Page 56: Overview

Generate HTMLGenerate HTMLFOA tutorial

1 2

34

1

2

Generate HTML command will open the XSL-T Processing dialog that uses makefilesBrowse for the exported XSL-T that generates HTML

3 Update the output file name simply changing the extension in .html

4 Run the XSL-T processor to generate the HTML version

Page 57: Overview

View HTMLView HTMLFOA tutorial

12

Page 58: Overview

Export: Print version in XSL-FOExport: Print version in XSL-FOFOA tutorial

12

3

4

5

1 Invoke the Export Wizard

Deselect to export the foa attributes (requires foa namespace) to have a clean deployable XSL-T

3

2 Set the Wizard Profile Name, this will be reflected in the XSL-T file name

4 Select the exporting mark-up language, in this case XSL-FO

5 After the export process a new XSL-T for generating FO is ready without the foa namespaces