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
Conferences Close Tree View
+ Stylus Studio Feature Requests (1123)
- Stylus Studio Technical Forum (13807)
-> + Mapping multiple files within ... (7)
-> + StylusStudio vs Altova vs BizT... (4)
-> + Command line execution (7)
-> + CSS and Styling in X15 (2)
-> + Ignores debug breakpoints in X... (5)
-> + Cursor dissapearing in Text vi... (4)
-> + compile error xquery java styl... (3)
-> + Stylus Studio Setup: Applicati... (10)
-> + Stylus StudioX15 Crashing whe... (4)
-> + Upgrade Stylus 14 to 15 (2)
-> + ACE Broker Download v2.5 (2)
-> + Help creating custom convertor (7)
-> + Problem saving Documentation (5)
-> + Registry keys for Stylus x15 (8)
-> + How to add a value when conver... (10)
-> + Stylus Studio Pro & Ent X15r1 ... (2)
-> + You need to install Java 2 SDK... (2)
-> - How to disable automatic and m... (1)
-> + Does Stylus Studio / DataDirec... (4)
-> + Stylus Studio fails with 'The ... (12)
-- [1-20] [21-40] [41-60] Next
+ Website Feedback (243)
+ XSLT Help and Discussion (7447)
+ XQuery Help and Discussion (1861)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (361)
+ Stylus Studio Announcements (113)
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

   
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-2011 All Rights Reserved.