XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
samir sawantSubject: XSL FO for output in diff format on diff pages for conditional logic
Author: samir sawant
Date: 16 Mar 2005 05:05 PM
Hi I have an XML as below
The XML will have only single row with 3 fields as below

<ROW>
<channel>Dealer</channel>
<Product>ABC </PRODUCT>
<Date> March 31, 2005</DATE>
</ROW>

I want to convert this into 3 pages PDF as below:

1st page
+++++++
will be having
Channel And product written on Left Hand Top and Date will be written on Left bottom.

2nd Page
++++++++
Static content through out the page based on the channel.
If channel is "Dealer" (as in this case) ...Then one type of static contenet.
If channel is "distributor", another Static content .
If channel is Wholesale , another static conetent

3rd Page
++++++++
Some Static Content

Postnext
Ivan PedruzziSubject: XSL FO for output in diff format on diff pages for conditional logic
Author: Ivan Pedruzzi
Date: 23 Mar 2005 10:46 PM
Samir


Take a look to the minimal-catalog.xsl to learn how to use XSL-FO
You can use fo:page-sequence to define 3 static pages

Ivan

Postnext
samir sawantSubject: XSL FO for output in diff format on diff pages for conditional logic
Author: samir sawant
Date: 24 Mar 2005 12:07 AM
where will i get this minimal-catalog.xsl..<br> <br> and how will i be able to change the static content based on my xml element

Posttop
Ivan PedruzziSubject: XSL FO for output in diff format on diff pages for conditional logic
Author: Ivan Pedruzzi
Date: 24 Mar 2005 12:39 AM

minimal-catalog.xsl is part of the example project under XSLFormattingObjects

Look at following example to lean how to process XML using XSLT
assuming in input

<?xml version="1.0"?>
<root>
<ROW>
<channel>Dealer</channel>
<Product>ABC</Product>
<Date>March 31, 2005</Date>
</ROW>
<ROW>
<channel>distributor</channel>
<Product>ABC</Product>
<Date>March 31, 2005</Date>
</ROW>
<ROW>
<channel>Wholesale</channel>
<Product>ABC</Product>
<Date>March 31, 2005</Date>
</ROW>
</root>

The following XSLT dispatch the processing in 3 different template

<?xml version='1.0'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

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

<xsl:template match="channel[.='Dealer']">
<xsl:text>Dealer
</xsl:text>
</xsl:template>

<xsl:template match="channel[.='distributor']">
<xsl:text>distributor
</xsl:text>
</xsl:template>

<xsl:template match="channel[.='Wholesale']">
<xsl:text>Wholesale
</xsl:text>
</xsl:template>

<xsl:template match="text()"/>

</xsl:stylesheet>


Now you just need to add the FO instructions
Hope this helps
Ivan

 
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.