Topic
  • No replies
antgoswa
antgoswa
1 Post

Pinned topic Adding Conditions in xsl:fo

‏2012-04-18T12:27:55Z |
Hi,,

I want to add conditions in the xsl:fo block, so that my watermark will print depending on the values in the xml.

My Input sample data file is :

<?xml version="1.0" encoding="UTF-8"?>
<Company>
<Organization rank = "true">
<Employee>
<Employee_Details>
<First_Name>Antara</First_Name>
<Last_Name>Goswami</Last_Name>
<DateOfBirth>1989-02-17</DateOfBirth>
<DateOfJoining>2011-03-18</DateOfJoining>
<AddressLine1>Kothaguda,Hyderabad</AddressLine1>
</Employee_Details>
<Employee_Id>39938_FS</Employee_Id>
<Company_Name>Capgemini</Company_Name>
</Employee>
</Organization>
<Organization rank = "false">
<Employee>
<Employee_Details>
<First_Name>Antara</First_Name>
<Last_Name>Goswami</Last_Name>
<DateOfBirth>1989-02-17</DateOfBirth>
<DateOfJoining>2011-03-18</DateOfJoining>
<AddressLine1>Kothaguda,Hyderabad</AddressLine1>
</Employee_Details>
<Employee_Id>39938_FS</Employee_Id>
<Company_Name>Wipro</Company_Name>
</Employee>
</Organization>
</Company>
And i have coded in the xsl:fo as below:

<fo:block-container reference-orientation="0">
<fo:block>
<xsl:for-each select="Company/Organization/Employee">
<xsl:choose>
<xsl:when test="Company_Name='Capgemini'" />
</xsl:choose>
</xsl:for-each>
<fo:instream-foreign-object height="920pt" content-height="scale-to-fit" content-width="scale-to-fit" width="400pt" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<svg:svg xmlns:svg="http://www.w3.org/2000/svg" width="680" height="920" xmlns="http://www.thunderhead.com/TML">
<svg:text font-family="Helvetica" font-size="32pt" style="fill:rgb(255,192,192)" x="-10" y="340" width="680" text-anchor="middle" transform="rotate(-54,230, 15)">Life Insurance Corporation of India.</svg:text>
</svg:svg>
</fo:instream-foreign-object>
</fo:block>
</fo:block-container>

But i m not getting the watermark even though in the xml Company_name is Capgemini.
Please give some input as to how to achieve this.
Thanks!