Generating XSL:FO from XSLT (and XML)

Discussion in 'XML' started by shauldar@gmail.com, Nov 9, 2005.

  1. Guest

    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:
     
    , Nov 9, 2005
    #1
    1. Advertising

  2. 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/tutorial1/tutorial1.html

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

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

    Converting Static HTML to XML
    http://www.stylusstudio.com/videos/tutorial4/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
     
    Stylus Studio, Nov 9, 2005
    #2
    1. Advertising

  3. Harrie Guest

    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
     
    Harrie, Nov 9, 2005
    #3
  4. Guest

    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, 2005
    #4
  5. Harrie Guest

    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
     
    Harrie, Nov 10, 2005
    #5
  6. 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.
     
    Tjerk Wolterink, Nov 10, 2005
    #6
  7. jon001

    Joined:
    Oct 30, 2011
    Messages:
    2
    You can use Apache FOP as runtime and J4L FO Designer as XSL-FO visual editor
     
    jon001, Nov 7, 2011
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Steve Dussinger
    Replies:
    3
    Views:
    500
    GIMME
    Dec 16, 2003
  2. Vijay singh
    Replies:
    1
    Views:
    455
    Martin Honnen
    Nov 4, 2004
  3. Replies:
    1
    Views:
    3,695
    A. Bolmarcich
    May 27, 2005
  4. Replies:
    2
    Views:
    731
  5. Andy Dingley
    Replies:
    3
    Views:
    568
    Martin Honnen
    Mar 27, 2007
Loading...

Share This Page