xsl-list
[Top] [All Lists]

Re: Modify the XSL output from HTML to XSL-Fo

2005-01-26 22:42:45


Hi,
     If the following stylesheet formats your input data and creates a
XHTML file, then creating a 'fo' file from the XHTML file and then a PDF
file is not very difficult provided you know something about XSL-FO and
FOP.

There are various sample files available at the following site
http://www.antennahouse.com that will help you achieve what you want.

Regards,
Omprakash.V



















                                                                                
                                   
                    samir sawant                                                
                                   
                    <cindy_mona(_at_)y        To:     
xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com                                
   
                    ahoo.com>            cc:     (bcc: omprakash.v/Polaris)     
                                   
                                         Subject:     [xsl] Modify the XSL  
output from HTML to XSL-Fo             
                    01/26/2005                                                  
                                   
                    03:20 AM                                                    
                                   
                    Please                                                      
                                   
                    respond to                                                  
                                   
                    xsl-list                                                    
                                   
                                                                                
                                   
                                                                                
                                   




Hi..

Thanks, Joris for that xsl.
Wnated the outupt in PDF though and hence want it in
FO.

Can anybody modify the below XSL to give output in FO
and inturn in PDF with apache fop?

Thanks
*****************************************


<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

<xsl:output indent="yes" method="html"/>

<xsl:variable name="size"
select="ceiling(count(root/region/row) div
2)"/>

<xsl:template match="root">
           <html>
                     <body>
                               <xsl:apply-templates select="region"/>
                     </body>
           </html>
</xsl:template>

<xsl:template match="region">
         <table>
                     <thead>
                               <th>field A</th>
                               <th>field B</th>
                     </thead>
                 <xsl:apply-templates
select="row[position() <=
$size]"/>
         </table>
</xsl:template>

<xsl:template match="row">
         <tr>
                 <xsl:apply-templates select="."
mode="col"/>
         </tr>
                     <xsl:if test="position() mod 5=0">
                     <tr><td><br/></td><td><br/></td></tr>
                     </xsl:if>
</xsl:template>

<xsl:template match="row" mode="col">
           <td style="border-right:1px solid black">
                               <xsl:apply-templates select="*"/>
           </td>
           <td>
                               <xsl:apply-templates
select="following-sibling::row[position()=$size]/*"/>
           </td>
</xsl:template>

<xsl:template match="field">
           <xsl:apply-templates/><xsl:text> </xsl:text>
</xsl:template>

</xsl:stylesheet>





__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--






This e-Mail may contain proprietary and confidential information and is sent 
for the intended recipient(s) only. 
If by an addressing or transmission error this mail has been misdirected to 
you, you are requested to delete this mail immediately.
You are also hereby notified that any use, any form of reproduction, 
dissemination, copying, disclosure, modification,
distribution and/or publication of this e-mail message, contents or its 
attachment other than by its intended recipient/s is strictly prohibited.

Visit Us at http://www.polaris.co.in

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>