468,505 Members | 1,569 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,505 developers. It's quick & easy.

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 4161
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by David | last post: by
reply views Thread by Manoj Nair | last post: by
reply views Thread by Rary | last post: by
1 post views Thread by yoyoyo | last post: by
13 posts views Thread by vm98123 | last post: by
8 posts views Thread by DarthLuch | last post: by
4 posts views Thread by pc.candy | last post: by
3 posts views Thread by =?Utf-8?B?Sm9zZW1h?= | last post: by
1 post views Thread by lskov | last post: by
reply views Thread by NPC403 | last post: by
3 posts views Thread by gieforce | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.