473,396 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Generating XSL:FO from XSLT (and XML)

Is there a way (tool, hack...) to create an XSL:FO from an XSLT + XML
files?

My motivation is that we want to use a tool to design reports, and from
that "design" generate both HTML (via XSLT) and PDF (via XSL:FO). The
only tool we have seen is Altova's StyleVision, which is very
unfriendly (and uses a proprietary representation, SPS, from which it
generates the various XSLs). We have considered instead using InfoPath,
which is WYSIWYG, friendly, and can generate XSLT. But we also need
XSL:FO for PDF, pagination, and getting non-trivial headers and
footers.

-- Shaul Dar

Chief Architect
Medcon Ltd.
Tel: +972-3-6487702 (ext. 335)
Email: sh****@medcon.com

Nov 9 '05 #1
5 4380
Try Stylus Studio XSL Tools - http://www.stylusstudio.com/xslt.html

Unlike that other tool, our XSLT designer operates on XSLT not SPS --
meaning it's a 'real' XSLT editing tool, allowing you to actually edit
the underlying XSLT code in either a visual WYSIWYG mode or a text
editor, and not just "save as" XSLT.

There are a couple of short, online video demonstrations that show how
to use the WYSIWYG XSLT Design Tools:

WYSIWYG XSLT Design in Stylus Studio:
http://www.stylusstudio.com/videos/t...tutorial1.html

Working with Tables in XSLT
http://www.stylusstudio.com/videos/t...tutorial2.html

Using XSLT Templates in the XSLT Designer
http://www.stylusstudio.com/videos/t...tutorial3.html

Converting Static HTML to XML
http://www.stylusstudio.com/videos/t...tutorial4.html

A free download is available here:
http://www.stylusstudio.com/xml_download.html

We don't yet have an XSL:FO designer - but do support some basic XSL:FO
editing and integrated transformation / preview using Apache FOP and
RenderX.
http://www.stylusstudio.com/xsl_fo_processing.html

Hope that helps.
Sincerely,
The Stylus Studio Team
http://www.stylusstudio.com

Nov 9 '05 #2
sh******@gmail.com said the following on 11/9/2005 16:04 +0200:
Is there a way (tool, hack...) to create an XSL:FO from an XSLT + XML
files?
Every XSL processor can do that (create XSL:FO files, they're "just" XML files), if I'm not mistaken. You only need a tool to change XSL:FO into PDF.

There are probably more, but I use FOP:

http://xmlgraphics.apache.org/fop/

It's free, open source software (and runs on all platforms which have java). It has some limitations with tables and probably on other aspects aswell, so make sure you read the FAQ.
My motivation is that we want to use a tool to design reports, and from
that "design" generate both HTML (via XSLT) and PDF (via XSL:FO).


I use xsltproc [1] for transformation to HTML (or text or XML), but Xalan [2] (which you get with FOP) can do that too.

[1] http://xmlsoft.org/XSLT/xsltproc2.html
[2] http://xml.apache.org/xalan/

Note: although xmlsoft says xsltproc is a tool for Gnome, you can use it without it. I don't "do" Gnome myself.

--
Regards
Harrie
Nov 9 '05 #3
Thanks for the reply. Looks like I didn't explain myself well or I am
using inaccurate terminology.

I have, using InfoPath or another XSLT editor, created an XSLT for
XML->HTML transformation. I need to have another XSLT for XS:FO
transformation. The actual rendering of the XSL:FO or PDF I can do with
many tools including your suggestions, but I need the definition. I
want the result of both XSLTs to be identical (i.e. the PDF should look
the same as the HTML). So my question was if there is a way to create
an XSLT for XSL:FO transformation from an XSLT for XML->HTML
transformation.

(I would also like to then modify the 2nd XSLT (XSL:FO) to define
headers and footers, control pagination etc, but thet's later).

Simply put I want to create one design for presenting XML (as a form or
report) and from it get 2 outputs: HTML+PDF. I can do this with
Altova's StyleVision, it is a tool for developers, and I was hoping to
find a simpler tool for less-technical people (InfoPath fits this bill
nicely, but only knows how to create the 1st XSLT).

-- Shaul

Nov 10 '05 #4
sh******@gmail.com said the following on 11/10/2005 08:52 +0200:
Thanks for the reply. Looks like I didn't explain myself well or I am
using inaccurate terminology.
No problem, I'm still quite new to this myself.
I have, using InfoPath or another XSLT editor, created an XSLT for
XML->HTML transformation. I need to have another XSLT for XS:FO
transformation. The actual rendering of the XSL:FO or PDF I can do with
many tools including your suggestions, but I need the definition. I
want the result of both XSLTs to be identical (i.e. the PDF should look
the same as the HTML). [..]
They can't be identical, since HTML is not paper. HTML (or a browser) has no knowledge about pages or paper size, PDF does. A good webpage needs to have a liquid design so it can be viewed independent of window size and screen resolution (for graphical browsers) and PDF is pixel exact.

But I guess I know what you mean, I'm experimenting with transforming an XML document to text, HTML and PDF. Currently I use three seperate XSL files which share a great deal of common code and in the future I want to try to write one XSL which generates those three XSL files. And like you, I like those text, HTML and PDF files to look as similar as possible.
[..] So my question was if there is a way to create
an XSLT for XSL:FO transformation from an XSLT for XML->HTML
transformation.
I don't know. I write my XSL files by hand and have no knowledge of tools other than xsltproc and FOP.

But from my (limited) experience, XSL:FO and HTML have much common grounds, like tables, block and inline elements (the styles can be different, there are some things the same as in CSS, others are not, which tend to confuse me), so your XSL file for HTML shouldn't be that hard to change for XSL:FO.
(I would also like to then modify the 2nd XSLT (XSL:FO) to define
headers and footers, control pagination etc, but thet's later).
I haven't been playing with that yet.
Simply put I want to create one design for presenting XML (as a form or
report) and from it get 2 outputs: HTML+PDF. I can do this with
Altova's StyleVision, it is a tool for developers, and I was hoping to
find a simpler tool for less-technical people (InfoPath fits this bill
nicely, but only knows how to create the 1st XSLT).


Sorry, I don't know, maybe the regular visitors of this group can be of any help.

--
Regards
Harrie
Nov 10 '05 #5
sh******@gmail.com wrote:
Thanks for the reply. Looks like I didn't explain myself well or I am
using inaccurate terminology.

I have, using InfoPath or another XSLT editor, created an XSLT for
XML->HTML transformation. I need to have another XSLT for XS:FO
transformation. The actual rendering of the XSL:FO or PDF I can do with
many tools including your suggestions, but I need the definition. I
want the result of both XSLTs to be identical (i.e. the PDF should look
the same as the HTML). So my question was if there is a way to create
an XSLT for XSL:FO transformation from an XSLT for XML->HTML
transformation.

(I would also like to then modify the 2nd XSLT (XSL:FO) to define
headers and footers, control pagination etc, but thet's later).

Simply put I want to create one design for presenting XML (as a form or
report) and from it get 2 outputs: HTML+PDF. I can do this with
Altova's StyleVision, it is a tool for developers, and I was hoping to
find a simpler tool for less-technical people (InfoPath fits this bill
nicely, but only knows how to create the 1st XSLT).

-- Shaul

Note that infopath uses allot of JavaScript! And it is totally
microsoft only.. so i wouldnt choose infopath.

Your XML->PDF+HTML problem can be solved like this:

Create your own style-xml-language and give it a name you like,
like XStyle, write 2 xsl for converting a XStyle XML file to pdf
or html:

xstyle2pdf.xsl
xstyle2html.xsl

And begin writing your xsl files that transform raw xml data to
xstyle. That you have to write only 1 xsl document for each styling,
and you can use your xstyle2pdf/html.xsl files to transform it to
the appropiate output language.

XML->XML2XSTYLE.xsl->XSTYLE
XSTYLE->xstyle2pdf.xsl->PDF
XSTYLE->xstyle2html.xsl->HTML

Understand?
It will be a lot of work to begin with, but once you have the 2
xstyle2pdf/html.xsl files you only have to write 1 xstyle xsl file.


Maybe my solution is not so good because you want a less technical
solution. :-)

I do not like wysiwg editors for xsl xml editing, it does not give
me the fine control that i want... so cant help you there.
Nov 10 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: David | last post by:
Hello list, I'm using XML + XSL + CSS to display my data to the web. I also want to publish my pages in PDF format. To accomplish this I first must transform my XML + XSL + CSS in XSL-FO. Is...
0
by: Manoj Nair | last post by:
I am using XSLT / XSL-FO to convert my XML to PDF file for the users to take a printout. Under certain conditions I need to have a watermark COPY on the printed paper . Can XSL-FO/XSLT do this for...
0
by: Rary | last post by:
I am using XSL:FO to generate PDF report for my XML, generating it in tables, i want that tables should completely be at one place, if there is a page break , all the contents of the table should...
1
by: yoyoyo | last post by:
hi all, i'm trying to build a search engine which could search within an xml document an that could give the results of the research to an xsl file (maybe using parameters).. i just wanted to...
13
by: vm98123 | last post by:
Hi, could someone please give me a clue to this one: I do have an xml-File and an xslt-File so that a browser can display the xml-file. What I am trying to do is convert this to pdf or...
8
by: DarthLuch | last post by:
Would like to get feedback on a process we do, as well as suggested alternatives. We produce a software for the airline biz... One of the features is take take aircraft OEM provided SGML/XML...
4
by: pc.candy | last post by:
Hi there I'm having some difficulty with transforming xml data with more than one namespace defined in the xml. I'm able to bring back some values of the xml but not others in another...
3
by: =?Utf-8?B?Sm9zZW1h?= | last post by:
Hi to all, I have a xml file with labels and data. Im trying to mix both files to generate someting like: Label A : data of node a Label B : data of node b Label C : data of node c
1
by: lskov | last post by:
Hey Im really new to XML and cant find a way how to not have xmlns as an attribute en every element. The xslt code is: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.