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.c om 5 4415 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
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 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 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.x sl->XSTYLE
XSTYLE->xstyle2pdf.x sl->PDF
XSTYLE->xstyle2html.xs l->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. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 there a know technique to
transform my data to XSL-FO without loosing my markup. For example,
transformation my data to XHTML first and later from XHTML to XSL-FO?
Hope someone can help me on this one.
|
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 me
under certain conditions? Or has this something to do with the paper
in printer having the COPY watermark.
Thanks
|
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 move to the
next page.
can any one suggest a way out?
This is my code (number 18, Brunelli Rocco, should move to the next
page):
XML:
<?xml version="1.0" encoding="windows-1252"?>
|
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 know if it is possible, and, if so, if you know where
i can find some information on how i can do it..
i'm building a webpage made by two frames, one of which contain the
search function, and another one should display the result i gained
through...
|
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 tiff.
I know that with fop you can convert xml + xsl-fo to pdf.
| |
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 data, mix it with data from
our own application, and show a PDF print of it. We save our own data
as xml, merge it with the OEM xml data, and use a stylesheet to control
how we want it to look. We use Apache FOP to turn it into a PDF.
...
|
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 namespace?
For example from the following xml data I can bring bring back the
value for <addressbut I can't seem to figure out how to bring back
the <CountryNameCodewhich is in another namespace.
I'm not able to manipulate the xml output, but I'm able to...
|
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
|
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" version="2.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema-instance">
<xsl:output method="xml" />
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |