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 (1166)
- Stylus Studio Technical Forum (14338)
-> + FileNotFoundException generati... (6)
-> + FO External Graphic Producing ... (2)
-> + Use of Java methodes (4)
-> + get generated XQuery output on... (2)
-> - right construct for involving ... (1)
-> + SS JRE Version has "Stylus Stu... (3)
-> + Trying to validate an XSD: co... (3)
-> + Disable "Output" windows (4)
-> + Stylus Studio V16 X64 update d... (2)
-> + Could not load the Java Virtua... (2)
-> + .NET XslCompileTransform strip... (6)
-> + XML Report Preview and Save Ev... (8)
-> + X16 Enterprise 32bit crash on ... (5)
-> - MSXML6.0 SAX Parser, "Index re... (1)
-> + MSXML6.0 DOM Parser stops afte... (4)
-> + How to disable checking for up... (2)
-> + XML Publisher requires duplica... (4)
-> + Modifying Field Name in XML (4)
-> + Java Runtime Environmnet Libra... (2)
-> + Passing Parameters and Multipl... (4)
-- [1-20] [21-40] [41-60] Next
+ Website Feedback (244)
+ XSLT Help and Discussion (7579)
+ XQuery Help and Discussion (1930)
+ 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-2016 All Rights Reserved.