aspose file tools*
The moose likes XML and Related Technologies and the fly likes problem with fop Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "problem with fop " Watch "problem with fop " New topic
Author

problem with fop

Shyam Sunder
Greenhorn

Joined: Dec 23, 2006
Posts: 24
I am using the xml and xsl and fop to create pdf



This is my xsl

************************************************************************
<xsl:stylesheet version = '1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:java="java">
<fo:layout-master-set>
<fo:simple-page-master
master-name="simpleA4"
page-height="21cm"
page-width="29.7cm"
margin-top="0.2cm"
margin-bottom="0.2cm"
margin-left="0.2cm"
margin-right="0.2cm"
>
<fo:region-body/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="simpleA4">
<fo:flow flow-name="xsl-region-body">
<fo:static-content flow-name="xsl-region-after">
<fo:block padding-after="5mm"/>
<fo:block text-align="center">Page No. <fo:page-number/></fo:block>
</fo:static-content>
</fo:flow>
</fo:page-sequence>

<xsl:template match="information">

<fo:table width="100%" space-before.optimum="1pt" space-after.optimum="2pt">

<fo:table-column column-width="proportional-column-width(17)" />
<fo:table-column column-width="proportional-column-width(15)" />
<fo:table-column column-width="proportional-column-width(15)" />
<fo:table-column column-width="proportional-column-width(15)" />
<fo:table-column column-width="proportional-column-width(15)" />
<fo:table-column column-width="proportional-column-width(15)" />
<fo:table-column column-width="proportional-column-width(15)" />
<fo:table-column column-width="proportional-column-width(15)" />
<fo:table-column column-width="proportional-column-width(15)" />
<fo:table-column column-width="proportional-column-width(15)" />
<fo:table-column column-width="proportional-column-width(15)" />
<fo:table-header>
<xsl:for-each select="headings">
<fo:table-row>

<fo:table-cell border-style="ridge" border-color="black" border-width="0.5mm" padding="0.5mm" background-color="#FFFFFF">

<fo:block font-family="Times"
font-size="9pt" font-weight="bold" text-align="center">
<xsl:value-of select="@col1"/>
</fo:block>

</fo:table-cell>

<fo:table-cell border-style="ridge" border-color="black" border-width="0.5mm" padding="0.5mm" background-color="#FFFFFF">
<fo:block font-family="Times"
font-size="9pt" font-weight="bold" text-align="center">
<xsl:value-of select="@col2"/>
</fo:block>
</fo:table-cell>
<fo:table-cell border-style="ridge" border-color="black" border-width="0.5mm" padding="0.5mm" background-color="#FFFFFF">
<fo:block font-family="Times"
font-size="9pt" font-weight="bold" text-align="center">
<xsl:value-of select="@col3"/>
</fo:block>
</fo:table-cell>

<fo:table-cell border-style="ridge" border-color="black" border-width="0.5mm" padding="0.5mm" background-color="#FFFFFF">

<fo:block font-family="Times"
font-size="9pt" font-weight="bold" text-align="center">
<xsl:value-of select="@col4"/>
</fo:block>
</fo:table-cell>

<fo:table-cell border-style="ridge" border-color="black" border-width="0.5mm" padding="0.5mm" background-color="#FFFFFF">

<fo:block font-family="Times"
font-size="9pt" font-weight="bold" text-align="center">
<xsl:value-of select="@col5"/>
</fo:block>

</fo:table-cell>
<fo:table-cell border-style="ridge" border-color="black" border-width="0.5mm" padding="0.5mm" background-color="#FFFFFF">




<fo:block font-family="Times"
font-size="9pt" font-weight="bold" text-align="center">
<xsl:value-of select="@col6"/>
</fo:block>


</fo:table-cell>
<fo:table-cell border-style="ridge" border-color="black" border-width="0.5mm" padding="0.5mm" background-color="#FFFFFF">

<fo:block font-family="Times"
font-size="9pt" font-weight="bold" text-align="center">
<xsl:value-of select="@col7"/>
</fo:block>

</fo:table-cell>
<fo:table-cell border-style="ridge" border-color="black" border-width="0.5mm" padding="0.5mm" background-color="#FFFFFF">



<fo:block font-family="Times"
font-size="9pt" font-weight="bold" text-align="center">
<xsl:value-of select="@col8"/>
</fo:block>


</fo:table-cell>
<fo:table-cell border-style="ridge" border-color="black" border-width="0.5mm" padding="0.5mm" background-color="#FFFFFF">

<fo:block font-family="Times"
font-size="9pt" font-weight="bold" text-align="center">
<xsl:value-of select="@col9"/>
</fo:block>


</fo:table-cell>
<fo:table-cell border-style="ridge" border-color="black" border-width="0.5mm" padding="0.5mm" background-color="#FFFFFF">


<fo:block font-family="Times"
font-size="9pt" font-weight="bold" text-align="center">
<xsl:value-of select="@col10"/>
</fo:block>

</fo:table-cell>
<fo:table-cell border-style="ridge" border-color="black" border-width="0.5mm" padding="0.5mm" background-color="#FFFFFF">

<fo:block font-family="Times"
font-size="9pt" font-weight="bold" text-align="center">
<xsl:value-of select="@col1"/>
</fo:block>

</fo:table-cell>

</fo:table-row>
</xsl:for-each>
</fo:table-header>


<fo:table-body>
<xsl:for-each select="field">
<fo:table-row>


<fo:table-cell border-style="ridge" border-color="black" border-width="0.2mm" padding="0.5mm" background-color="#FFFFFF">
<fo:block padding-after="0.5mm"/>
<fo:block font-family="Times" hyphenate="true" language="en"
font-size="9pt" text-align="center">
<xsl:value-of select="@Transaction_Date"/>
</fo:block>
</fo:table-cell>


<fo:table-cell border-style="ridge" border-color="black" border-width="0.2mm" padding="0.5mm" background-color="#FFFFFF">
<fo:block padding-after="0.5mm"/>
<fo:block font-family="Times" hyphenate="true" language="en"
font-size="9pt" text-align="center">
<xsl:value-of select="@Number_Nominal"/>
</fo:block>
</fo:table-cell>


<fo:table-cell border-style="ridge" border-color="black" border-width="0.2mm" padding="0.5mm" background-color="#FFFFFF">
<fo:block padding-after="0.5mm"/>

<fo:block font-family="Times" hyphenate="true" language="en"
font-size="9pt" text-align="center">
<xsl:value-of select="@Security_Name"/>
</fo:block>
</fo:table-cell>


<fo:table-cell border-style="ridge" border-color="black" border-width="0.2mm" padding="0.5mm" background-color="#FFFFFF">
<fo:block padding-after="0.5mm"/>
<fo:block font-family="Times" hyphenate="true" language="en"
font-size="9pt" text-align="center">
<xsl:value-of select="@Price_Local_Currency"/>
</fo:block>
</fo:table-cell>


<fo:table-cell border-style="ridge" border-color="black" border-width="0.2mm" padding="0.5mm" background-color="#FFFFFF">
<fo:block padding-after="0.5mm"/>

<fo:block font-family="Times" hyphenate="true" language="en"
font-size="11pt" text-align="center">
<xsl:value-of select="@Local_Currency"/>
</fo:block>

</fo:table-cell>

<fo:table-cell border-style="ridge" border-color="black" border-width="0.2mm" padding="0.5mm" background-color="#FFFFFF">
<fo:block padding-after="0.5mm"/>
<fo:block font-family="Times" hyphenate="true" language="en"
font-size="11pt" text-align="center">
<xsl:value-of select="@XCH_RATE"/>
</fo:block>
</fo:table-cell>

<fo:table-cell border-style="ridge" border-color="black" border-width="0.2mm" padding="0.5mm" background-color="#FFFFFF">
<fo:block padding-after="0.5mm"/>

<fo:block font-family="Times" hyphenate="true" language="en"
font-size="11pt" text-align="center">
<xsl:value-of select="@TRANSACTION_TYPE"/>
</fo:block>

</fo:table-cell>


<fo:table-cell border-style="ridge" border-color="black" border-width="0.2mm" padding="0.5mm" background-color="#FFFFFF">
<fo:block padding-after="0.5mm"/>

<fo:block font-family="Times" hyphenate="true" language="en"
font-size="11pt" text-align="center">
<xsl:value-of select="@Broker_Name"/>
</fo:block>

</fo:table-cell>


<fo:table-cell border-style="ridge" border-color="black" border-width="0.2mm" padding="0.5mm" background-color="#FFFFFF">
<fo:block padding-after="0.5mm"/>

<fo:block font-family="Times" hyphenate="true" language="en"
font-size="11pt" text-align="center">
<xsl:value-of select="@Taxable_Domestic_securities"/>
</fo:block>

</fo:table-cell>

<fo:table-cell border-style="ridge" border-color="black" border-width="0.2mm" padding="0.5mm" background-color="#FFFFFF">
<fo:block padding-after="0.5mm"/>

<fo:block font-family="Times" hyphenate="true" language="en"
font-size="pt" text-align="center">
<xsl:value-of select="@Taxable_Foreign_securities"/>
</fo:block>

</fo:table-cell>

<fo:table-cell border-style="ridge" border-color="black" border-width="0.2mm" padding="0.5mm" background-color="#FFFFFF">
<fo:block padding-after="1mm"/>

<fo:block font-family="Times" hyphenate="true" language="en"
font-size="11pt" text-align="center">
<xsl:value-of select="@Transactions_already_Taxed"/>
</fo:block>

</fo:table-cell>

</fo:table-row>
</xsl:for-each>


</fo:table-body>

</fo:table>



</xsl:template>

</xsl:stylesheet>
**************************************************************************
below is my xml
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
<?xml version="1.0" encoding="UTF-8"?>
<information>
<headings col1="Transaction " col2="Number Nominal" col3="Security Name" col4="Price in Local Currency" col5="Local Currency" col6="Local Currency" col7="Transaction Type" col8="Broker Name" col9="Taxable Domestic Securities" col10="Taxable Foreign Securities" col11="Already Taxed"/>
<field Transaction_Date="12/12/2006" Number_Nominal="10101" Security_Name="Reliance" Price_Local_Currency="8977" Local_Currency="987" XCH_RATE="1.2" TRANSACTION_TYPE="Buy" Broker_Name="gold" Taxable_Domestic_securities="2342" Taxable_Foreign_securities="22454" Transactions_already_Taxed="230709"/>
</information>
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&


and i am getting the error like this

[INFO] FOP 0.20.4
[INFO] building formatting object tree
[ERROR] java.lang.NullPointerException


what would be wrong.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem with fop