Apache FOP Displaying ### instead of Arabic - pdf-generation

I am new to Apache-FOP.
I use this to generate PDF documet from a XML input. I have created XSL for my input XML and getting ### values instead of Arabic text. Can any one please point out the mistake? I have set of fonts but still I cannot get the right result.
XML Input:
<TestData>
<TestXML>
<Name>Sathish நன்றி</Name>
<Dept>Channels</Dept>
<Year>2016</Year>
</TestXML>
<TestXML>
<Name>Sathish dėkoju</Name>
<Dept>Channels</Dept>
<Year>2016</Year>
</TestXML>
<TestXML>
<Name>Sathish благодаря</Name>
<Dept>Channels</Dept>
<Year>2016</Year>
</TestXML>
<TestXML>
<Name>Sathish شكر</Name>
<Dept>Channels</Dept>
<Year>2016</Year>
</TestXML>
</TestData>
XSL:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">
<xsl:template match="/">
<fo:root>
<fo:layout-master-set>
<fo:simple-page-master master-name="A4-portrait" page-height="29.7cm" page-width="21.0cm" margin="2cm">
<fo:region-body />
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="A4-portrait">
<fo:flow flow-name="xsl-region-body">
<fo:block>
<fo:table table-layout="fixed" width="100%">
<fo:table-header>
<fo:table-row background-color="#c0c0c0" height="0.59cm">
<fo:table-cell number-columns-spanned="1">
<fo:block margin-left="0.0cm" margin-right="0.14cm" margin-top="0.0cm" font-size="10pt" color="#000000" text-align="left">Name</fo:block>
</fo:table-cell>
<fo:table-cell number-columns-spanned="1">
<fo:block margin-left="0.51cm" margin-right="0.16cm" margin-top="0.0cm" font-size="10pt" color="#000000" text-align="left">Department</fo:block>
</fo:table-cell>
<fo:table-cell number-columns-spanned="1">
<fo:block margin-left="0.0cm" margin-right="2.65cm" margin-top="0.0cm" font-size="10pt" color="#000000" text-align="left">Year</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-header>
<fo:table-body>
<xsl:for-each select="TestData/TestXML">
<fo:table-row background-color="#ffffff" height="0.57cm">
<fo:table-cell number-columns-spanned="1">
<fo:block margin-left="0.0cm" margin-right="0.14cm" margin-top="0.0cm" font-size="10pt" color="#000000" text-align="left">
<xsl:value-of select="Name" />
</fo:block>
</fo:table-cell>
<fo:table-cell number-columns-spanned="1">
<fo:block margin-left="0.0cm" margin-right="0.14cm" margin-top="0.0cm" font-size="10pt" color="#000000" text-align="left">
<xsl:value-of select="Dept" />
</fo:block>
</fo:table-cell>
<fo:table-cell number-columns-spanned="1">
<fo:block margin-left="0.0cm" margin-right="0.14cm" margin-top="0.0cm" font-size="10pt" color="#000000" text-align="left">
<xsl:value-of select="Year" />
</fo:block>
</fo:table-cell>
</fo:table-row>
</xsl:for-each>
</fo:table-body>
</fo:table>
</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template>
</xsl:stylesheet>
myConf.xconf:
<fop>
<renderers>
<renderer mime="application/pdf">
<fonts>
<auto-detect/>
</fonts>
</renderer>
</renderers>
</fop>
WARNINGS:
12 Aug, 2016 4:47:31 PM org.apache.fop.events.LoggingEventListener processEvent
WARNING: Glyph "?" (0xba8) not available in font "Helvetica".
12 Aug, 2016 4:47:31 PM org.apache.fop.events.LoggingEventListener processEvent
WARNING: Glyph "?" (0xba9) not available in font "Helvetica".
12 Aug, 2016 4:47:31 PM org.apache.fop.events.LoggingEventListener processEvent
WARNING: Glyph "?" (0xbcd) not available in font "Helvetica".
12 Aug, 2016 4:47:31 PM org.apache.fop.events.LoggingEventListener processEvent
WARNING: Glyph "?" (0xbb1) not available in font "Helvetica".
Result:
Sathish ##### Channels 2016
Sathish d#koju Channels 2016
Sathish ######### Channels 2016
Result Image

Related

XSLT scheme for create a table whose header and rows are separate and hierarchical

I have a problem in order to convert a file that looks like this into a "flat" table
These files are uploaded during the exchange. There are many of them, but they have one template. First a description of the headers, then only the values.
<?xml version="1.0" encoding="UTF-8"?>
<extdata user="test">
<scheme name="CRMOrder" request="get" success="true">
<data>
<s>
<d name="CRMOrder">
<f name="ActionDate" type="Date" />
<f name="CRMClientId" type="String" />
<f name="CreateId" type="Date" />
<f name="StatusId" type="String" />
<f name="Summa" type="Decimal" />
<f name="WareHouseId" type="String" />
<d name="CRMOrderLine">
<f name="Price" type="Decimal" />
<f name="LineNumber" type="Integer" />
<f name="Quantity" type="Decimal" />
<f name="Discount" type="Integer" />
</d>
<d name="CRMOrderOption">
<f name="OptionTypeId" type="String" />
<f name="Value" type="String" />
<f name="OptionTypeName" type="String" />
</d>
</d>
</s>
<o>
<d name="CRMOrder">
<r>
<f>2022-01-11T00:00:00</f>
<f>69244</f>
<f>2142256774</f>
<f>Accepted</f>
<f>2318.0600</f>
<f>62</f>
<d name="CRMOrderLine">
<r>
<f>64.7800</f>
<f>1</f>
<f>18.0000</f>
<f>62</f>
</r>
<d name="CRMOrderOption">
<r>
<f>2022-01-10T00:00:00</f>
<f>Comment</f>
<f>1</f>
</r>
</d>
</d>
</r>
</d>
</o>
</data>
</scheme>
</extdata>
XSLT
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" indent="yes" />
<xsl:template match="/extdata/scheme/data">
<ValueTable xmlns="http://v8.1c.ru/8.1/data/core" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<-- get the total number of columns -->
<xsl:variable name="recordColumn" select="count(s/d/f/#name) + count(s/d/d/f/#name)" />
<-- I didn’t understand how to create headers in one cycle, so there are two cycles with the same content -->
<xsl:for-each select="s/d/f">
<column>
<Name xsi:type="xs:string">
<xsl:value-of select="#name" />
</Name>
<ValueType>
<xsl:if test="#type= 'String'">
<Type>xs:string</Type>
<StringQualifiers>
<Length>150</Length>
<AllowedLength>Variable</AllowedLength>
</StringQualifiers>
</xsl:if>
<xsl:if test="#type= 'Date'">
<Type>xs:dateTime</Type>
<DateQualifiers>
<DateFractions>DateTime</DateFractions>
</DateQualifiers>
</xsl:if>
<xsl:if test="#type= 'Decimal' or #type= 'Currency'">
<Type>xs:decimal</Type>
<NumberQualifiers>
<Digits>20</Digits>
<FractionDigits>4</FractionDigits>
<AllowedSign>Any</AllowedSign>
</NumberQualifiers>
</xsl:if>
<xsl:if test="#type= 'Integer'">
<Type>xs:decimal</Type>
<NumberQualifiers>
<Digits>20</Digits>
<FractionDigits>0</FractionDigits>
<AllowedSign>Any</AllowedSign>
</NumberQualifiers>
</xsl:if>
</ValueType>
</column>
</xsl:for-each>
<xsl:for-each select="s/d/d/f">
<column>
<Name xsi:type="xs:string">
<xsl:value-of select="#name" />
</Name>
<ValueType>
<xsl:if test="#type= 'String'">
<Type>xs:string</Type>
<StringQualifiers>
<Length>150</Length>
<AllowedLength>Variable</AllowedLength>
</StringQualifiers>
</xsl:if>
<xsl:if test="#type= 'Date'">
<Type>xs:dateTime</Type>
<DateQualifiers>
<DateFractions>DateTime</DateFractions>
</DateQualifiers>
</xsl:if>
<xsl:if test="#type= 'Decimal' or #type= 'Currency'">
<Type>xs:decimal</Type>
<NumberQualifiers>
<Digits>20</Digits>
<FractionDigits>4</FractionDigits>
<AllowedSign>Any</AllowedSign>
</NumberQualifiers>
</xsl:if>
<xsl:if test="#type= 'Integer'">
<Type>xs:decimal</Type>
<NumberQualifiers>
<Digits>20</Digits>
<FractionDigits>0</FractionDigits>
<AllowedSign>Any</AllowedSign>
</NumberQualifiers>
</xsl:if>
</ValueType>
</column>
</xsl:for-each>
<xsl:for-each select="o/d/r/f">
<-- Problem is here -->
<xsl:variable name="counter" select="position()" />
<xsl:if test="$counter = 1">
<xsl:text disable-output-escaping="yes"><row></xsl:text>
</xsl:if>
<xsl:if test="$counter mod $recordColumn = 0">
<xsl:text disable-output-escaping="yes"></row></xsl:text>
<xsl:if test="$counter != last() ">
<xsl:text disable-output-escaping="yes"><row></xsl:text>
</xsl:if>
</xsl:if>
<xsl:if test="$counter mod $recordColumn != 0">
<Value>
<xsl:value-of select="." />
</Value>
</xsl:if>
</xsl:for-each>
</ValueTable>
</xsl:template>
</xsl:stylesheet>
How do i get the table from this file. The beginning and end of the row about the string and value probably did not look very beautiful, but it works. There are now 12 columns, as a result, my table row contains only 6 first values.
Expected result
<ValueTable xmlns="http://v8.1c.ru/8.1/data/core"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<column>
<Name xsi:type="xs:string">ActionDate</Name>
<ValueType>
<Type>xs:dateTime</Type>
<DateQualifiers>
<DateFractions>DateTime</DateFractions>
</DateQualifiers>
</ValueType>
</column>
<column>
<Name xsi:type="xs:string">CRMClientId</Name>
<ValueType>
<Type>xs:string</Type>
<StringQualifiers>
<Length>150</Length>
<AllowedLength>Variable</AllowedLength>
</StringQualifiers>
</ValueType>
</column>
<column>
<Name xsi:type="xs:string">CreateId</Name>
<ValueType>
<Type>xs:dateTime</Type>
<DateQualifiers>
<DateFractions>DateTime</DateFractions>
</DateQualifiers>
</ValueType>
</column>
<column>
<Name xsi:type="xs:string">StatusId</Name>
<ValueType>
<Type>xs:string</Type>
<StringQualifiers>
<Length>150</Length>
<AllowedLength>Variable</AllowedLength>
</StringQualifiers>
</ValueType>
</column>
<column>
<Name xsi:type="xs:string">Summa</Name>
<ValueType>
<Type>xs:decimal</Type>
<NumberQualifiers>
<Digits>20</Digits>
<FractionDigits>4</FractionDigits>
<AllowedSign>Any</AllowedSign>
</NumberQualifiers>
</ValueType>
</column>
<column>
<Name xsi:type="xs:string">WareHouseId</Name>
<ValueType>
<Type>xs:string</Type>
<StringQualifiers>
<Length>150</Length>
<AllowedLength>Variable</AllowedLength>
</StringQualifiers>
</ValueType>
</column>
<column>
<Name xsi:type="xs:string">Price</Name>
<ValueType>
<Type>xs:decimal</Type>
<NumberQualifiers>
<Digits>20</Digits>
<FractionDigits>4</FractionDigits>
<AllowedSign>Any</AllowedSign>
</NumberQualifiers>
</ValueType>
</column>
<column>
<Name xsi:type="xs:string">LineNumber</Name>
<ValueType>
<Type>xs:decimal</Type>
<NumberQualifiers>
<Digits>20</Digits>
<FractionDigits>0</FractionDigits>
<AllowedSign>Any</AllowedSign>
</NumberQualifiers>
</ValueType>
</column>
<column>
<Name xsi:type="xs:string">Quantity</Name>
<ValueType>
<Type>xs:decimal</Type>
<NumberQualifiers>
<Digits>20</Digits>
<FractionDigits>4</FractionDigits>
<AllowedSign>Any</AllowedSign>
</NumberQualifiers>
</ValueType>
</column>
<column>
<Name xsi:type="xs:string">Discount</Name>
<ValueType>
<Type>xs:decimal</Type>
<NumberQualifiers>
<Digits>20</Digits>
<FractionDigits>0</FractionDigits>
<AllowedSign>Any</AllowedSign>
</NumberQualifiers>
</ValueType>
</column>
<Name xsi:type="xs:string">OptionTypeId</Name>
<ValueType>
<Type>xs:string</Type>
<StringQualifiers>
<Length>150</Length>
<AllowedLength>Variable</AllowedLength>
</StringQualifiers>
</ValueType>
</column>
<column>
<Name xsi:type="xs:string">Value</Name>
<ValueType>
<Type>xs:string</Type>
<StringQualifiers>
<Length>150</Length>
<AllowedLength>Variable</AllowedLength>
</StringQualifiers>
</ValueType>
</column>
<column>
<Name xsi:type="xs:string">OptionTypeName</Name>
<ValueType>
<Type>xs:string</Type>
<StringQualifiers>
<Length>150</Length>
<AllowedLength>Variable</AllowedLength>
</StringQualifiers>
</ValueType>
</column>
<row>
<Value>2022-01-11T00:00:00</Value>
<Value>69244</Value>
<Value>2142256774</Value>
<Value>Accepted</Value>
<Value>2318.0600</Value>
<Value>62</Value>
<Value>64.7800</Value>
<Value>1</Value>
<Value>18.0000</Value>
<Value>62</Value>
<Value>2022-01-10T00:00:00</Value>
<Value>Comment</Value>
<Value>1</Value>
</row>
</ValueTable>
The given example is somewhat ambiguous. Assuming that s is the header row, and that o is a data row containing exactly one value for each column in the header row, and in the same order (IOW, that the input is already a "flat" table), the result shown could be produced using:
XSLT 1.0
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://v8.1c.ru/8.1/data/core"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/extdata">
<ValueTable>
<!-- header -->
<xsl:for-each select="scheme/data/s//f">
<column>
<Name xsi:type="xs:string">
<xsl:value-of select="#name"/>
</Name>
<ValueType>
<xsl:choose>
<xsl:when test="#type= 'String'">
<Type>xs:string</Type>
<StringQualifiers>
<Length>150</Length>
<AllowedLength>Variable</AllowedLength>
</StringQualifiers>
</xsl:when>
<xsl:when test="#type='Date'">
<Type>xs:dateTime</Type>
<DateQualifiers>
<DateFractions>DateTime</DateFractions>
</DateQualifiers>
</xsl:when>
<xsl:when test="#type='Decimal' or #type='Currency'">
<Type>xs:decimal</Type>
<NumberQualifiers>
<Digits>20</Digits>
<FractionDigits>4</FractionDigits>
<AllowedSign>Any</AllowedSign>
</NumberQualifiers>
</xsl:when>
<xsl:when test="#type='Integer'">
<Type>xs:decimal</Type>
<NumberQualifiers>
<Digits>20</Digits>
<FractionDigits>0</FractionDigits>
<AllowedSign>Any</AllowedSign>
</NumberQualifiers>
</xsl:when>
</xsl:choose>
</ValueType>
</column>
</xsl:for-each>
<!-- data -->
<xsl:for-each select="scheme/data/o">
<row>
<xsl:for-each select=".//f">
<Value>
<xsl:value-of select="."/>
</Value>
</xsl:for-each>
</row>
</xsl:for-each>
</ValueTable>
</xsl:template>
</xsl:stylesheet>
Unfortunately your provided XML is invalid. And you don't provide an example how the output should look like.
But however, just a quick, hopefully helpful answer to your main problem. How to avoid repeating the whole header definition or other stylesheet parts.
You can OR multiple paths in XPath
<xsl:for-each select="s/d/f | s/d/d/f">

Apache FOP image not hide

I set margin-right:1.0in.
The last column show the image but hide the text. I know the last column is overflow, but why the the image is showing but the text not?
How to hide all of the content include the image?
The file content is like below:
<?xml version="1.0" encoding="UTF-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master page-height="8.5in" page-width="14.0in" margin-left="0.1in" margin-right="1.0in" margin-bottom="0.2in" margin-top="0.2in" master-name="all-pages">
<fo:region-body region-name="xsl-region-body" margin-bottom="0.1in" margin-top="0.1in"/>
<fo:region-before extent="0.1in" region-name="xsl-region-header"/>
<fo:region-after extent="0.1in" region-name="xsl-region-footer"/>
</fo:simple-page-master>
<fo:page-sequence-master master-name="reportSeqn1PageMasterParametersSet">
<fo:repeatable-page-master-reference master-reference="all-pages"/>
</fo:page-sequence-master>
<fo:page-sequence-master master-name="reportSeqn1PageMasterColumnSet1">
<fo:repeatable-page-master-reference master-reference="all-pages"/>
</fo:page-sequence-master>
<fo:page-sequence-master master-name="reportSeqn1PageMasterColumnSet2">
<fo:repeatable-page-master-reference master-reference="all-pages"/>
</fo:page-sequence-master>
<fo:page-sequence-master master-name="reportSeqn1PageMasterImageSet">
<fo:repeatable-page-master-reference master-reference="all-pages"/>
</fo:page-sequence-master>
</fo:layout-master-set>
<fo:page-sequence force-page-count="no-force" master-reference="reportSeqn1PageMasterColumnSet1" initial-page-number="1">
<fo:static-content flow-name="xsl-region-header">
<fo:block font-family="Arial" font-size="8pt" text-align="end">Dec 07, 2016</fo:block>
<fo:block font-family="Arial" font-size="8pt" text-align="end">05:55 PM</fo:block>
<fo:block font-weight="normal" font-family="Arial" font-size="12pt" text-align="center" text-decoration="none">Finance Integration Tasks</fo:block>
</fo:static-content>
<fo:static-content flow-name="xsl-region-footer">
<fo:block font-family="Arial" font-size="8pt" text-align="end">
Page <fo:page-number/> Column set 1 of 2</fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
<fo:block-container width="1653.2640000000001pt">
<fo:block font-family="Arial" font-size="8pt" margin-top="5pt">
<fo:table table-layout="fixed" width="1653.2640000000001pt">
<fo:table-column column-number="1" column-width="84.43636363636364pt"/>
<fo:table-column column-number="2" column-width="84.43636363636364pt"/>
<fo:table-column column-number="3" column-width="84.43636363636364pt"/>
<fo:table-column column-number="4" column-width="84.43636363636364pt"/>
<fo:table-column column-number="5" column-width="84.43636363636364pt"/>
<fo:table-column column-number="6" column-width="84.43636363636364pt"/>
<fo:table-column column-number="7" column-width="84.43636363636364pt"/>
<fo:table-column column-number="8" column-width="84.43636363636364pt"/>
<fo:table-column column-number="9" column-width="84.43636363636364pt"/>
<fo:table-column column-number="10" column-width="84.43636363636364pt"/>
<fo:table-column column-number="11" column-width="84.43636363636364pt"/>
<fo:table-column column-number="12" column-width="724.464pt"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell padding="2pt" border-bottom-color="rgb(200,215,227)" border-top-color="rgb(200,215,227)" border-right-color="rgb(200,215,227)" border-left-color="rgb(200,215,227)" border-style="solid" border-width="0.25pt" background-color="rgb(51,102,153)">
<fo:block text-align="start" color="rgb(255,255,255)"># of Critical Issues</fo:block>
</fo:table-cell>
<fo:table-cell padding="2pt" border-bottom-color="rgb(200,215,227)" border-top-color="rgb(200,215,227)" border-right-color="rgb(200,215,227)" border-left-color="rgb(200,215,227)" border-style="solid" border-width="0.25pt" background-color="rgb(51,102,153)">
<fo:block text-align="start" color="rgb(255,255,255)">Description</fo:block>
</fo:table-cell>
<fo:table-cell padding="2pt" border-bottom-color="rgb(200,215,227)" border-top-color="rgb(200,215,227)" border-right-color="rgb(200,215,227)" border-left-color="rgb(200,215,227)" border-style="solid" border-width="0.25pt" background-color="rgb(51,102,153)">
<fo:block text-align="start" color="rgb(255,255,255)"># of Other Issues</fo:block>
</fo:table-cell>
<fo:table-cell padding="2pt" border-bottom-color="rgb(200,215,227)" border-top-color="rgb(200,215,227)" border-right-color="rgb(200,215,227)" border-left-color="rgb(200,215,227)" border-style="solid" border-width="0.25pt" background-color="rgb(51,102,153)">
<fo:block text-align="start" color="rgb(255,255,255)">Test</fo:block>
</fo:table-cell>
<fo:table-cell padding="2pt" border-bottom-color="rgb(200,215,227)" border-top-color="rgb(200,215,227)" border-right-color="rgb(200,215,227)" border-left-color="rgb(200,215,227)" border-style="solid" border-width="0.25pt" background-color="rgb(51,102,153)">
<fo:block text-align="start" color="rgb(255,255,255)">Test1</fo:block>
</fo:table-cell>
<fo:table-cell padding="2pt" border-bottom-color="rgb(200,215,227)" border-top-color="rgb(200,215,227)" border-right-color="rgb(200,215,227)" border-left-color="rgb(200,215,227)" border-style="solid" border-width="0.25pt" background-color="rgb(51,102,153)">
<fo:block text-align="start" color="rgb(255,255,255)">Test2</fo:block>
</fo:table-cell>
<fo:table-cell padding="2pt" border-bottom-color="rgb(200,215,227)" border-top-color="rgb(200,215,227)" border-right-color="rgb(200,215,227)" border-left-color="rgb(200,215,227)" border-style="solid" border-width="0.25pt" background-color="rgb(51,102,153)">
<fo:block text-align="start" color="rgb(255,255,255)">Test3</fo:block>
</fo:table-cell>
<fo:table-cell padding="2pt" border-bottom-color="rgb(200,215,227)" border-top-color="rgb(200,215,227)" border-right-color="rgb(200,215,227)" border-left-color="rgb(200,215,227)" border-style="solid" border-width="0.25pt" background-color="rgb(51,102,153)">
<fo:block text-align="start" color="rgb(255,255,255)">Test4</fo:block>
</fo:table-cell>
<fo:table-cell padding="2pt" border-bottom-color="rgb(200,215,227)" border-top-color="rgb(200,215,227)" border-right-color="rgb(200,215,227)" border-left-color="rgb(200,215,227)" border-style="solid" border-width="0.25pt" background-color="rgb(51,102,153)">
<fo:block text-align="start" color="rgb(255,255,255)">Test5</fo:block>
</fo:table-cell>
<fo:table-cell padding="2pt" border-bottom-color="rgb(200,215,227)" border-top-color="rgb(200,215,227)" border-right-color="rgb(200,215,227)" border-left-color="rgb(200,215,227)" border-style="solid" border-width="0.25pt" background-color="rgb(51,102,153)">
<fo:block text-align="start" color="rgb(255,255,255)">Test6</fo:block>
</fo:table-cell>
<fo:table-cell padding="2pt" border-bottom-color="rgb(200,215,227)" border-top-color="rgb(200,215,227)" border-right-color="rgb(200,215,227)" border-left-color="rgb(200,215,227)" border-style="solid" border-width="0.25pt" background-color="rgb(51,102,153)">
<fo:block text-align="start" color="rgb(255,255,255)">Test7</fo:block>
</fo:table-cell>
<fo:table-cell padding="2pt" border-bottom-color="rgb(255,255,255)" border-top-color="rgb(255,255,255)" border-right-color="rgb(255,255,255)" border-left-color="rgb(200,215,227)" border-style="solid" border-width="0.25pt" background-color="rgb(255,255,255)">
<fo:block text-align="start" color="rgb(255,255,255)">title</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell padding="2pt" border-bottom-color="rgb(200,215,227)" border-top-color="rgb(200,215,227)" border-right-color="rgb(200,215,227)" border-left-color="rgb(200,215,227)" border-style="solid" border-width="0.25pt" background-color="#ffff00">
<fo:block-container >
<fo:block font-family="Arial" color="Black" text-align="left">
<fo:inline xmlns:exslt="http://exslt.org/common" color="Black" font-weight="normal" font-style="normal" text-decoration="none">Tin
Can</fo:inline>
</fo:block>
</fo:block-container>
</fo:table-cell>
<fo:table-cell padding="2pt" border-bottom-color="rgb(200,215,227)" border-top-color="rgb(200,215,227)" border-right-color="rgb(200,215,227)" border-left-color="rgb(200,215,227)" border-style="solid" border-width="0.25pt" background-color="rgb(255,255,255)">
<fo:block-container >
<fo:block font-family="Arial" color="Red" text-align="left" font-weight="bold">
<fo:inline xmlns:exslt="http://exslt.org/common" color="Red" font-weight="bold" font-style="normal" text-decoration="none">ABCD</fo:inline>
</fo:block>
</fo:block-container>
</fo:table-cell>
<fo:table-cell padding="2pt" border-bottom-color="rgb(200,215,227)" border-top-color="rgb(200,215,227)" border-right-color="rgb(200,215,227)" border-left-color="rgb(200,215,227)" border-style="solid" border-width="0.25pt" background-color="rgb(255,255,255)">
<fo:block-container >
<fo:block font-family="Arial" color="Black" text-align="center">
<fo:inline xmlns:exslt="http://exslt.org/common" color="Black" font-weight="normal" font-style="normal" text-decoration="none">4</fo:inline>
</fo:block>
</fo:block-container>
</fo:table-cell>
<fo:table-cell padding="2pt" border-bottom-color="rgb(200,215,227)" border-top-color="rgb(200,215,227)" border-right-color="rgb(200,215,227)" border-left-color="rgb(200,215,227)" border-style="solid" border-width="0.25pt" background-color="rgb(255,255,255)">
<fo:block-container >
<fo:block font-family="Arial" color="Black" text-align="right">
<fo:inline xmlns:exslt="http://exslt.org/common" color="Black" font-weight="normal" font-style="normal" text-decoration="none">19</fo:inline>
</fo:block>
</fo:block-container>
</fo:table-cell>
<fo:table-cell padding="2pt" border-bottom-color="rgb(200,215,227)" border-top-color="rgb(200,215,227)" border-right-color="rgb(200,215,227)" border-left-color="rgb(200,215,227)" border-style="solid" border-width="0.25pt" background-color="rgb(255,255,255)">
<fo:block-container >
<fo:block font-family="Arial" color="Black" text-align="left">
<fo:inline xmlns:exslt="http://exslt.org/common" color="Black" font-weight="normal" font-style="normal" text-decoration="none">Tin
Can</fo:inline>
</fo:block>
</fo:block-container>
</fo:table-cell>
<fo:table-cell padding="2pt" border-bottom-color="rgb(200,215,227)" border-top-color="rgb(200,215,227)" border-right-color="rgb(200,215,227)" border-left-color="rgb(200,215,227)" border-style="solid" border-width="0.25pt" background-color="rgb(255,255,255)">
<fo:block-container >
<fo:block font-family="Arial" color="#000000" text-align="left">ABCD</fo:block>
</fo:block-container>
</fo:table-cell>
<fo:table-cell padding="2pt" border-bottom-color="rgb(200,215,227)" border-top-color="rgb(200,215,227)" border-right-color="rgb(200,215,227)" border-left-color="rgb(200,215,227)" border-style="solid" border-width="0.25pt" background-color="rgb(255,255,255)">
<fo:block-container >
<fo:block font-family="Arial" color="#000000" text-align="left">Tin Can</fo:block>
</fo:block-container>
</fo:table-cell>
<fo:table-cell padding="2pt" border-bottom-color="rgb(200,215,227)" border-top-color="rgb(200,215,227)" border-right-color="rgb(200,215,227)" border-left-color="rgb(200,215,227)" border-style="solid" border-width="0.25pt" background-color="rgb(255,255,255)">
<fo:block-container >
<fo:block font-family="Arial" color="#000000" text-align="left">ABCD</fo:block>
</fo:block-container>
</fo:table-cell>
<fo:table-cell padding="2pt" border-bottom-color="rgb(200,215,227)" border-top-color="rgb(200,215,227)" border-right-color="rgb(200,215,227)" border-left-color="rgb(200,215,227)" border-style="solid" border-width="0.25pt" background-color="rgb(255,255,255)">
<fo:block-container >
<fo:block font-family="Arial" color="#000000" text-align="left">Tin Can</fo:block>
</fo:block-container>
</fo:table-cell>
<fo:table-cell padding="2pt" border-bottom-color="rgb(200,215,227)" border-top-color="rgb(200,215,227)" border-right-color="rgb(200,215,227)" border-left-color="rgb(200,215,227)" border-style="solid" border-width="0.25pt" background-color="rgb(255,255,255)">
<fo:block-container >
<fo:block font-family="Arial" color="#000000" text-align="left">ABCD</fo:block>
</fo:block-container>
</fo:table-cell>
<fo:table-cell padding="2pt" border-bottom-color="rgb(200,215,227)" border-top-color="rgb(200,215,227)" border-right-color="rgb(200,215,227)" border-left-color="rgb(200,215,227)" border-style="solid" border-width="0.25pt" background-color="rgb(255,255,255)">
<fo:block-container >
<fo:block font-family="Arial" color="Black" text-align="right">
<fo:inline xmlns:exslt="http://exslt.org/common" color="Black" font-weight="normal" font-style="normal" text-decoration="none">Tin
Can</fo:inline>
</fo:block>
</fo:block-container>
</fo:table-cell>
<fo:table-cell padding="2pt" border-bottom-color="rgb(255,255,255)" border-top-color="rgb(255,255,255)" border-right-color="rgb(255,255,255)" border-left-color="rgb(200,215,227)" border-style="solid" border-width="0.25pt" background-color="rgb(255,255,255)">
<fo:block-container >
<fo:block font-family="Arial" color="rgb(255,255,255)" text-align="left">
<fo:inline xmlns:exslt="http://exslt.org/common" font-weight="normal" font-style="normal">ABCD</fo:inline> <fo:external-graphic src="url('file:///C:/Users/sujianrong/Desktop/fop-2.1-bin.tar/fop-2.1-bin/fop-2.1/examples/fo/graphics/fop.jpg')" content-width="10pt" /> </fo:block>
</fo:block-container>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:block>
</fo:block-container>
<fo:block id="reportSeqn1last-pageColumnSet2"/>
</fo:flow>
</fo:page-sequence>
</fo:root>
Add overflow="hidden" to the fo:region-body.
See https://www.w3.org/TR/xsl11/#overflow

xslt sorting for some part of a file

I'm very new to XSLT, and I want to sort a part of XML file.(keeping all the file data)
Here's the file :
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="test.xsd">
<SchemaVersion>1.0</SchemaVersion>
<Header>### uVision Project, (C) Keil Software</Header>
<Extensions>
<cExt>*.c</cExt>
<aExt>*.s*; *.src; *.a*</aExt>
<oExt>*.obj</oExt>
<lExt>*.lib</lExt>
<tExt>*.txt; *.h; *.inc</tExt>
<pExt>*.plm</pExt>
<CppX>*.cpp</CppX>
<nMigrate>0</nMigrate>
</Extensions>
<DateTime>
<dwLowDateTime>0</dwLowDateTime>
<dwHighDateTime>0</dwHighDateTime>
</DateTime>
<Target>
<TargetName>LYNX_XERIUS_APRR_CPU2006_0091</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<TargetOption>
<OPTTT>
<gFlags>0</gFlags>
</OPTTT>
<AAA>
<SetRegEntry>
<Number>0</Number>
</SetRegEntry>
</AAA>
<Breakpoint>
<Bp>
<Number>0</Number>
</Bp>
<Bp>
<Number>1</Number>
</Bp>
<Bp>
<Number>2</Number>
</Bp>
<Bp>
<Number>3</Number>
</Bp>
<Bp>
<Number>4</Number>
</Bp>
</Breakpoint>
<Tracepoint>
<THDelay>0</THDelay>
</Tracepoint>
<DebugFlag>
<trace>0</trace>
</DebugFlag>
<LintExecutable></LintExecutable>
</TargetOption>
</Target>
<Target>
<TargetName>Debug</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<TargetOption>
<OPTTT>
<gFlags>0</gFlags>
</OPTTT>
<AAA>
<SetRegEntry>
<Number>0</Number>
</SetRegEntry>
</AAA>
<Breakpoint>
<Bp>
<Number>0</Number>
</Bp>
<Bp>
<Number>1</Number>
</Bp>
<Bp>
<Number>2</Number>
</Bp>
<Bp>
<Number>3</Number>
</Bp>
<Bp>
<Number>4</Number>
</Bp>
</Breakpoint>
<Tracepoint>
<THDelay>0</THDelay>
</Tracepoint>
<DebugFlag>
<trace>0</trace>
</DebugFlag>
<LintExecutable></LintExecutable>
</TargetOption>
</Target>
<Target>
<TargetName>LYNX_HERMES_APRR_SERIE_200</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<TargetOption>
<OPTTT>
<gFlags>0</gFlags>
</OPTTT>
<AAA>
<SetRegEntry>
<Number>0</Number>
</SetRegEntry>
</AAA>
<Breakpoint>
<Bp>
<Number>0</Number>
</Bp>
<Bp>
<Number>1</Number>
</Bp>
<Bp>
<Number>2</Number>
</Bp>
<Bp>
<Number>3</Number>
</Bp>
<Bp>
<Number>4</Number>
</Bp>
</Breakpoint>
<Tracepoint>
<THDelay>0</THDelay>
</Tracepoint>
<DebugFlag>
<trace>0</trace>
</DebugFlag>
<LintExecutable></LintExecutable>
</TargetOption>
</Target>
<Group>
<GroupName>::CMSIS</GroupName>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>1</RteFlg>
</Group>
</Project>
Here's my XSLT :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ns="urn:TestNamespace" >
<xsl:output indent="yes" />
<xsl:strip-space elements="*"/>
<xsl:template match="text()[not(string-length(normalize-space()))]"/>
<xsl:template match="Project">
<xsl:copy>
<xsl:apply-templates select="Target">
<xsl:sort select="TargetName"/>
</xsl:apply-templates>
</xsl:copy>
</xsl:template>
<!-- global template to copy everything that doesn't match the other templates -->
<xsl:template match="#*|node()">
<xsl:copy>
<xsl:apply-templates select="#*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
I got a XML file sorted by TargetName as output, but with only Target nodes....
How can I setup the select case to keep the unfiltered nodes ?
I also tested with :
<xsl:copy>
<xsl:apply-templates select="#*"/>
<xsl:apply-templates select="Target">
<xsl:sort select="TargetName"/>
</xsl:apply-templates>
</xsl:copy>
In this case, all data is kept but there is no sorting ?
I will appreciate some explanation to improve my knowledge.
Best Regards
One approach is:
<xsl:template match="Project">
<xsl:copy>
<xsl:apply-templates select="node()">
<xsl:sort select="TargetName" />
</xsl:apply-templates>
</xsl:copy>
</xsl:template>
Why is your solution not working:
<xsl:apply-templates select="Target">
You select only Target to apply further.
I would probably do this (using XSLT 2.0):
<xsl:template match="Project">
<xsl:copy>
<xsl:for-each-group select="*" group-adjacent="node-name()">
<xsl:apply-templates>
<xsl:sort select="TargetName"/>
</xsl:apply-templates>
</xsl:for-each-group>
</xsl:copy>
</xsl:template>
on the assumption that sorting groups of elements other than Target elements does no harm. But it would probably be cleaner to have a conditional (xsl:choose) inside the xsl:for-each-group so the sorting is only done when test="self::Target".

How to access variable as parameter from another template XSLT

Hello I have one problem, I have 2 variables(min_value and max_value) they are in different templates MIN and MAX, in MAX I want to calculate the difference between max_value and min_value but the result is NAN since min_value values are not transferred from one template to another.
<xsl:template match="MAX">
<xsl:param name= "min_value"/>
<xsl:variable name="max_value" select= "SHARE_RATE"/>
<span class="max_rate">
MAX: <xsl:apply-templates select="SHARE_RATE"/>
</span>
<br/>
<span class= "diff">
Diff: (<xsl:value-of select="$max_value - $min_value"/>)
</span>
</xsl:template>
<xsl:template match="MIN">
<xsl:variable name="min_value" select="SHARE_RATE"/>
<span class="SHARE_RATE">
MIN: <xsl:apply-templates select="SHARE_RATE"/>
</span>
<xsl:apply-templates select="MAX">
<xsl:with-param name="min_value" select= "$min_value"/>
</xsl:apply-templates>
</xsl:template>
UPDATE
<page shareid="%" min_rate="%" max_rate="%" skip="0">
<TRANSACTIONS>
<MIN num="1">
<SHAREID>0</SHAREID>
<SHARE_RATE>1200</SHARE_RATE>
</MIN>
<MIN num="2">
<SHAREID>1</SHAREID>
<SHARE_RATE>4200</SHARE_RATE>
</MIN>
<MIN num="3">
<SHAREID>2</SHAREID>
<SHARE_RATE>1600</SHARE_RATE>
</MIN>
<MIN num="4">
<SHAREID>3</SHAREID>
<SHARE_RATE>6100</SHARE_RATE>
</MIN>
<MIN num="5">
<SHAREID>4</SHAREID>
<SHARE_RATE>550</SHARE_RATE>
</MIN>
<MIN num="6">
<SHAREID>5</SHAREID>
<SHARE_RATE>420</SHARE_RATE>
</MIN>
<MIN num="7">
<SHAREID>6</SHAREID>
<SHARE_RATE>2000</SHARE_RATE>
</MIN>
</TRANSACTIONS>
<TRANSACTIONS>
<MAX num="1">
<SHAREID>0</SHAREID>
<SHARE_RATE>2100</SHARE_RATE>
</MAX>
<MAX num="2">
<SHAREID>1</SHAREID>
<SHARE_RATE>5200</SHARE_RATE>
</MAX>
<MAX num="3">
<SHAREID>2</SHAREID>
<SHARE_RATE>2000</SHARE_RATE>
</MAX>
<MAX num="4">
<SHAREID>3</SHAREID>
<SHARE_RATE>7000</SHARE_RATE>
</MAX>
<MAX num="5">
<SHAREID>4</SHAREID>
<SHARE_RATE>1000</SHARE_RATE>
</MAX>
<MAX num="6">
<SHAREID>5</SHAREID>
<SHARE_RATE>2520</SHARE_RATE>
</MAX>
<MAX num="7">
<SHAREID>5</SHAREID>
<SHARE_RATE>2520</SHARE_RATE>
</MAX>
</TRANSACTIONS>
</page>
UPDATE 2
<?xml version="1.0" encoding="ISO-8859-2"?>
<?xml-stylesheet type="text/xsl" href="share.xsl"?>
<page connection="labor"
xmlns:xsql="urn:oracle-xsql"
shareid="%"
min_rate= "%"
max_rate= "%"
skip="0">
<xsql:query rowset-element="TRANSACTIONS"
row-element="MIN"
skip-rows="{#skip}"
max-rows="{#max-rows}"
bind-params="shareid min_rate ">
SELECT
f77inq.shares.shareid, A.share_rate
FROM
f77inq.trans A
INNER JOIN f77inq.shares ON A.shareid = f77inq.shares.shareid
WHERE A.shareid LIKE ?
AND A.share_rate=
(
SELECT
MIN(share_rate)
FROM
f77inq.trans B
WHERE
B.shareid = A.shareid
)
AND A.share_rate LIKE?
</xsql:query>
<xsql:query rowset-element="TRANSACTIONS"
row-element="MAX"
skip-rows="{#skip}"
max-rows="{#max-rows}"
bind-params="shareid">
SELECT
f77inq.shares.shareid, A.share_rate
FROM
f77inq.trans A
INNER JOIN f77inq.shares ON A.shareid = f77inq.shares.shareid
WHERE A.shareid LIKE ?
AND A.share_rate=
(
SELECT
MAX(share_rate)
FROM
f77inq.trans B
WHERE
B.shareid = A.shareid
)
</xsql:query>
</page>
I would suggest you use a key to link the MIN and MAX values, based on a common SHAREID. Here's an example that uses XML output for better clarity:
XSLT 1.0
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:key name="max" match="MAX" use="SHAREID" />
<xsl:template match="/page">
<root>
<xsl:apply-templates select="TRANSACTIONS/MIN"/>
</root>
</xsl:template>
<xsl:template match="MIN">
<xsl:variable name="id" select="SHAREID" />
<xsl:variable name="min" select="SHARE_RATE" />
<xsl:variable name="max" select="key('max', $id)/SHARE_RATE" />
<share id="{$id}">
<min><xsl:value-of select="$min"/></min>
<max><xsl:value-of select="$max"/></max>
<diff><xsl:value-of select="$max - $min"/></diff>
</share>
</xsl:template>
</xsl:stylesheet>
Applied to your example input, the result is:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<share id="0">
<min>1200</min>
<max>2100</max>
<diff>900</diff>
</share>
<share id="1">
<min>4200</min>
<max>5200</max>
<diff>1000</diff>
</share>
<share id="2">
<min>1600</min>
<max>2000</max>
<diff>400</diff>
</share>
<share id="3">
<min>6100</min>
<max>7000</max>
<diff>900</diff>
</share>
<share id="4">
<min>550</min>
<max>1000</max>
<diff>450</diff>
</share>
<share id="5">
<min>420</min>
<max>2520</max>
<diff>2100</diff>
</share>
<share id="6">
<min>2000</min>
<max>2520</max>
<diff>520</diff>
</share>
</root>
ok, what I understand is, that you want to match MIN/MAX values with the same SHAREID. In this case the following xslt might do what you need:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes" indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template match="MAX">
<xsl:variable name="id" select="SHAREID"/>
<!-- or '0' handles the case where no coresponding MIN/SHARE_RATE is found -->
<xsl:variable name="min_value" select="//MIN[SHAREID=$id]/SHARE_RATE or '0'"/>
<xsl:variable name="max_value" select= "SHARE_RATE"/>
<span class="max_rate">
MAX: <xsl:value-of select="$max_value"/>
</span>
<br/>
<span class= "diff">
Diff: (<xsl:value-of select="$max_value - $min_value"/>)
</span>
</xsl:template>
<!-- MAX does it all, so ignore output of MIN -->
<xsl:template match="MIN"/>
<xsl:template match="*">
<xsl:apply-templates/>
</xsl:template>
</xsl:stylesheet>

Background-image not displays in xsl fo with Relative Path URL

I am trying to create a pdf using xsl-fo where the background image is being used. I have set up the relative path as follows:
background-image = "url('../themes/images/logo.gif')"
When I give absolute path like background-image="C://Images/logo.gif", it worked.
but when I use url to take it relatively in the server, it is not working.
Below is my scenario.
XML:
<?xml version="1.0" encoding="iso-8859-1"?>
<form-data>
<field>
<name>txtFirstName</name>
<value>ABC</value>
</field>
<field>
<name>txtLastName</name>
<value>XYZ</value>
</field>
</form-data>
XSL-FO ( to get the Pdf )
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">
<xsl:template match="/">
<fo:root>
<fo:layout-master-set>
<fo:simple-page-master master-name="SPM_Name" page-height="29.7cm" page-width="21cm" margin-top="1.2cm" margin-bottom="1.2cm" margin-left="1.75cm" margin-right="1.75cm">
<fo:region-body margin-top="0.5cm" />
<fo:region-before extent="0.5cm" />
<fo:region-after extent="1cm" />
</fo:simple-page-master>
<fo:page-sequence-master master-name="PSM_Name">
<fo:single-page-master-reference master-reference="SPM_Name" />
</fo:page-sequence-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="PSM_Name" initial-page-number="1">
<fo:static-content flow-name="xsl-region-before">
<fo:block text-align="end" font-size="10pt" font-family="serif" line-height="14pt">
Page
<fo:page-number />
</fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
<fo:block background-image="url('http://localhost:9081/resources/themes/images/Logo1.gif')" background-position="right" background-color="transparent" >
</fo:block>
<fo:block font-size="20pt" text-align="center" font-family="sans-serif" line-height="20pt" space-after.optimum="15pt" padding-top="18pt">Income Tax Form</fo:block>
<fo:table table-layout="fixed" width="100%" border-collapse="separate">
<fo:table-column column-width="50%" />
<fo:table-column column-width="50%" />
<fo:table-header text-align="center">
<fo:table-row>
<fo:table-cell padding="6pt" border="0.5pt solid black" wrap-option="wrap" keep-together.within-column="always">
<fo:block font-weight="solid">Questions</fo:block>
</fo:table-cell>
<fo:table-cell padding="6pt" border="0.5pt solid black" wrap-option="wrap" keep-together.within-column="always">
<fo:block font-weight="solid">Form Inputs</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-header>
<fo:table-body text-align="center">
<fo:table-row>
<fo:table-cell padding="6pt" border="0.5pt solid black" wrap-option="wrap" keep-together.within-column="always">
<fo:block>Your First Name</fo:block>
</fo:table-cell>
<fo:table-cell padding="6pt" border="0.5pt solid black" wrap-option="wrap" keep-together.within-column="always">
<fo:block>
<xsl:value-of select="//field/value[../name/text() = 'txtFirstName']" />
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell padding="6pt" border="0.5pt solid black" wrap-option="wrap" keep-together.within-column="always">
<fo:block>Your Last Name</fo:block>
</fo:table-cell>
<fo:table-cell padding="6pt" border="0.5pt solid black" wrap-option="wrap" keep-together.within-column="always">
<fo:block>
<xsl:value-of select="//field/value[../name/text() = 'txtLastName']" />
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template>
</xsl:stylesheet>
As you say in the comments that you don't get any "Image not found" warning, I think there is nothing wrong with the image URL.
Your stylesheet puts the image as background of an empty fo:block:
<fo:block background-image="url('http://localhost:9081/resources/themes/images/Logo1.gif')"
background-position="right" background-color="transparent" >
</fo:block>
An empty fo:block produces a single block area whose height is 0pt, so its background is not visible.
If your image must be the background for the whole page, use an absolute positioned fo:block-container instead:
<fo:block-container position="absolute" height="25cm"
background-image="url('http://localhost:9081/resources/themes/images/Logo1.gif')"
background-position="right" background-color="transparent" >
<fo:block/>
</fo:block-container>
the height attribute sets the height of the generated area, i.e. the area which will have the desired background (use the height you want)
you can also use the properties background-repeat and background-position-horizontal to control repetion and position of the image
the empty fo:block inside the container is needed if your FO processor is strict about validation (Apache FOP is, and it would give a validation exception if the block-container were empty)

Resources