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 (1144)
- Stylus Studio Technical Forum (14123)
-> - need additinal field in XML (1)
-> + blinking (3)
-> + HELP ANYONE PLEASE (3)
-> + xi:include including include s... (2)
-> + Validating an XML file against... (2)
-> + XML to EDI Telco D.0 field len... (2)
-> - Converting EDIFACT to XML in c... (1)
-> + XSLT Transformation fails with... (4)
-> + StylusStudio X15 R2 java Auto ... (6)
-> + StylusStudio X15 Review - firs... (2)
-> + Stylus Studio X15 stuck on pro... (11)
-> + Error handling in Coverter fil... (2)
-> + RESTful Web Services in Stylus... (3)
-> + How to produce a human-readabl... (3)
-> + EDI 945 to AX (2)
-> + Help x15 failing install (5)
-> + XSD 1.0/1.1 schema validation ... (3)
-> + Java Runtime Environment 8.0 (3)
-> + Web Service Call to Oracle OSM... (2)
-> + Telco EDI to XML output on opt... (12)
-- [1-20] [21-40] [41-60] Next
+ Website Feedback (244)
+ XSLT Help and Discussion (7506)
+ XQuery Help and Discussion (1890)
+ 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.