You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Christian Neuroth <no...@gmx.de> on 2003/04/25 11:50:14 UTC

HTML render class available?

Hi!

As I am a newbie to FOP, I am not sure whether my post makes sense or not.

I really enjoy working with FOP: I use one XSL-FO sheet to generate plain
text,
PDF and even SVG documents. The resulting docs have the same layout. Since
the layout is very complex, we require that the layout is configured in only
one
XSL-FO stylesheet.

The only thing that I am missing, is a render class for HTML as we are also
in need of a HTML doc. Does anyone have a solution for this?

Regards + Thanks!

Christian


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


RE: HTML render class available?

Posted by Torsten Erler <To...@net-linx.com>.
No I don't think that anyone has written this Renderer, because you've to
translate the whole fo-reference back into html syntax, which would be like
a shot from the back through the breast into the eye.

You can try to write it, but before take a look at
http://www.w3.org/TR/xsl/slice7.html

Each generated FO tag/property has to be translated and replaced by html
tags for outputting.
Have fun ;)

cu Torsten

> -----Original Message-----
> From: Christian Neuroth [mailto:nollario@gmx.de]
> Sent: Freitag, 25. April 2003 14:18
> To: fop-user@xml.apache.org; Torsten.Erler@net-linx.com
> Subject: Re: HTML render class available?
>
>
> > your xsl stylesheet can contain:
> > <table>
> > <tr>
> > <td><xsl:value-of select="something_in_your_xml"/></td>
> > </tr>
> > <table>
> >
> > the resultig FO is:
> > <table>
> > <tr>
> > <td>ThatsTheDataFromXML</td>
> > </tr>
> > <table>
> >
> > DONE
>
> yep. I understand that I can create a XSL stylesheet like
> your example. But
> I try to write a Java application which simply switches
> between different
> render classes to realize different output formats:
>
>     // Setup renderer (output format)
>     driver.setRenderer(Driver.RENDER_PDF);
>
> The only thing that I have to change is the parameter for the
> setRenderer
> method. There are renderer available for SVG, PDF, PS, PCL and so on.
> However, not for HTML. And I am looking for someone, who perhaps did
> implement a renderer for HTML or has some useful hints how I
> can do this.
>
> Thanks.
>
> Christian
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: fop-user-help@xml.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: HTML render class available?

Posted by William Gilbert <Gi...@Informagen.com>.
> I agree with both. Up to now I generate HTML vis XSL and PDF via XSL->FOP.
> Fortunately, my incoming XSL is very HTML-like, where it isn't I write a
> custom XSL transform.

Boo-boo...  Line two should read XML not XSL:

I agree with both. Up to now I generate HTML vis XSL and PDF via XSL->FOP.
Fortunately, my incoming XML is very HTML-like, where it isn't I write a
custom XSL transform.


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: HTML render class available?

Posted by William Gilbert <Gi...@Informagen.com>.
> yep. I understand that I can create a XSL stylesheet like your example. But
> I try to write a Java application which simply switches between different
> render classes to realize different output formats:
> 
>   // Setup renderer (output format)
>   driver.setRenderer(Driver.RENDER_PDF);
> 
> The only thing that I have to change is the parameter for the setRenderer
> method. There are renderer available for SVG, PDF, PS, PCL and so on.
> However, not for HTML. And I am looking for someone, who perhaps did
> implement a renderer for HTML or has some useful hints how I can do this.

I agree with both. Up to now I generate HTML vis XSL and PDF via XSL->FOP.
Fortunately, my incoming XSL is very HTML-like, where it isn't I write a
custom XSL transform.

However, it would be nice to have an HTML output from the FO Processor in
order to minimize the amount of custom work to be done per project.  If the
client then request 'better' HTML then write it and bill 'em for it.


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: HTML render class available?

Posted by Christian Neuroth <no...@gmx.de>.
> your xsl stylesheet can contain:
> <table>
> <tr>
> <td><xsl:value-of select="something_in_your_xml"/></td>
> </tr>
> <table>
>
> the resultig FO is:
> <table>
> <tr>
> <td>ThatsTheDataFromXML</td>
> </tr>
> <table>
>
> DONE

yep. I understand that I can create a XSL stylesheet like your example. But
I try to write a Java application which simply switches between different
render classes to realize different output formats:

    // Setup renderer (output format)
    driver.setRenderer(Driver.RENDER_PDF);

The only thing that I have to change is the parameter for the setRenderer
method. There are renderer available for SVG, PDF, PS, PCL and so on.
However, not for HTML. And I am looking for someone, who perhaps did
implement a renderer for HTML or has some useful hints how I can do this.

Thanks.

Christian



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


RE: HTML render class available?

Posted by Torsten Erler <To...@net-linx.com>.
False you dont use XML->PDF, XML->PS, XML->SVG

 you're using XML+XSL->FO->PDF, XML+XSL->FO->PS..

for HTML you need XML+XSL->FO where FO is your friend.

your xsl stylesheet can contain:
<table>
	<tr>
		<td><xsl:value-of select="something_in_your_xml"/></td>
	</tr>
<table>

the resultig FO is:
<table>
	<tr>
		<td>ThatsTheDataFromXML</td>
	</tr>
<table>

DONE

hope that helps

> -----Original Message-----
> From: Christian Neuroth [mailto:nollario@gmx.de]
> Sent: Freitag, 25. April 2003 13:40
> To: fop-user@xml.apache.org
> Subject: Re: HTML render class available?
> 
> 
> Hi!
> 
> Thanks for your fast reply, Amit. However, what I was looking 
> for was a way
> to transform XML into HTML with the help of FOP.
> 
> Until now, I can do XML->PDF, XML->PS, XML->SVG, because 
> there are render
> classes for those document types... I am looking for a subclass of
> org.apache.fop.render.AbstractRenderer, which supports the 
> transformation of
> XML into HTML. This would be great because I would then only 
> have one XSL-FO
> sheet, which is used for all desired document formats.
> 
> Thanks,
> 
> Christian
> 
> > here is a XSL to render XML in to FO.
> >
> http://www-106.ibm.com/developerworks/library/x-xslfo2app/xhtm
> l-to-xslfo.xsl
> >
> > i hope this will help you.
> >
> > Amit Kaushik
> >
> >
> > ----- Original Message -----
> > From: "Christian Neuroth" <no...@gmx.de>
> > To: <fo...@xml.apache.org>
> > Sent: Friday, April 25, 2003 3:20 PM
> > Subject: HTML render class available?
> >
> >
> > > Hi!
> > >
> > > As I am a newbie to FOP, I am not sure whether my post 
> makes sense or
> not.
> > >
> > > I really enjoy working with FOP: I use one XSL-FO sheet 
> to generate
> plain
> > > text,
> > > PDF and even SVG documents. The resulting docs have the 
> same layout.
> Since
> > > the layout is very complex, we require that the layout is 
> configured in
> > only
> > > one
> > > XSL-FO stylesheet.
> > >
> > > The only thing that I am missing, is a render class for 
> HTML as we are
> > also
> > > in need of a HTML doc. Does anyone have a solution for this?
> > >
> > > Regards + Thanks!
> > >
> > > Christian
> > >
> > >
> > > 
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
> > > For additional commands, e-mail: fop-user-help@xml.apache.org
> > >
> > >
> >
> >
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
> > For additional commands, e-mail: fop-user-help@xml.apache.org
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: fop-user-help@xml.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: HTML render class available?

Posted by Christian Neuroth <no...@gmx.de>.
Hi!

Thanks for your fast reply, Amit. However, what I was looking for was a way
to transform XML into HTML with the help of FOP.

Until now, I can do XML->PDF, XML->PS, XML->SVG, because there are render
classes for those document types... I am looking for a subclass of
org.apache.fop.render.AbstractRenderer, which supports the transformation of
XML into HTML. This would be great because I would then only have one XSL-FO
sheet, which is used for all desired document formats.

Thanks,

Christian

> here is a XSL to render XML in to FO.
>
http://www-106.ibm.com/developerworks/library/x-xslfo2app/xhtml-to-xslfo.xsl
>
> i hope this will help you.
>
> Amit Kaushik
>
>
> ----- Original Message -----
> From: "Christian Neuroth" <no...@gmx.de>
> To: <fo...@xml.apache.org>
> Sent: Friday, April 25, 2003 3:20 PM
> Subject: HTML render class available?
>
>
> > Hi!
> >
> > As I am a newbie to FOP, I am not sure whether my post makes sense or
not.
> >
> > I really enjoy working with FOP: I use one XSL-FO sheet to generate
plain
> > text,
> > PDF and even SVG documents. The resulting docs have the same layout.
Since
> > the layout is very complex, we require that the layout is configured in
> only
> > one
> > XSL-FO stylesheet.
> >
> > The only thing that I am missing, is a render class for HTML as we are
> also
> > in need of a HTML doc. Does anyone have a solution for this?
> >
> > Regards + Thanks!
> >
> > Christian
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
> > For additional commands, e-mail: fop-user-help@xml.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: fop-user-help@xml.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: HTML render class available?

Posted by amit kaushik <ak...@expressindia.com>.
Hi Christian,

here is a XSL to render XML in to FO.
http://www-106.ibm.com/developerworks/library/x-xslfo2app/xhtml-to-xslfo.xsl

i hope this will help you.

Amit Kaushik


----- Original Message -----
From: "Christian Neuroth" <no...@gmx.de>
To: <fo...@xml.apache.org>
Sent: Friday, April 25, 2003 3:20 PM
Subject: HTML render class available?


> Hi!
>
> As I am a newbie to FOP, I am not sure whether my post makes sense or not.
>
> I really enjoy working with FOP: I use one XSL-FO sheet to generate plain
> text,
> PDF and even SVG documents. The resulting docs have the same layout. Since
> the layout is very complex, we require that the layout is configured in
only
> one
> XSL-FO stylesheet.
>
> The only thing that I am missing, is a render class for HTML as we are
also
> in need of a HTML doc. Does anyone have a solution for this?
>
> Regards + Thanks!
>
> Christian
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: fop-user-help@xml.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: HTML render class available?

Posted by Ralf Butterweck <ra...@ubh.de>.
There is a XSLT-stylesheet for FO->HTML transformation:
  http://www.renderx.com/fo2html.html

first step:       XML+XSL->FO
second step: FO +XSL  ->HMTL

Hope thats help


Date sent:      	Fri, 25 Apr 2003 11:50:14 +0200
From:           	Christian Neuroth <no...@gmx.de>
Subject:        	HTML render class available?
To:             	fop-user@xml.apache.org
Send reply to:  	fop-user@xml.apache.org

> Hi!
> 
> As I am a newbie to FOP, I am not sure whether my post makes sense or not.
> 
> I really enjoy working with FOP: I use one XSL-FO sheet to generate plain
> text, PDF and even SVG documents. The resulting docs have the same layout.
> Since the layout is very complex, we require that the layout is configured in
> only one XSL-FO stylesheet.
> 
> The only thing that I am missing, is a render class for HTML as we are also in
> need of a HTML doc. Does anyone have a solution for this?
> 
> Regards + Thanks!
> 
> Christian
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: fop-user-help@xml.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: HTML render class available?

Posted by Clay Leeds <cl...@medata.com>.
> Christian Neuroth wrote:
>>The only thing that I am missing, is a render class for HTML as
>>we are also
>>in need of a HTML doc. Does anyone have a solution for this?

Ralph Butterweck's explanation pretty much nailed it (note the link to
RenderX's fo2html stylesheet page):

> There is a XSLT-stylesheet for FO->HTML transformation:
>   http://www.renderx.com/fo2html.html
> 
> first step:       XML+XSL->FO
> second step: FO +XSL  ->HMTL
> 
> Hope thats help

Having never done XML=>HTML before, these two simple steps worked
surprisingly well for me. Here's how I transformed my XML & XSL files
into HTML using the xalan.bat file included (thanks!) with FOP (watch wrap):

NOTE: xalan command line arguments:
xalan.bat -in <XML-IN-FILE> -xsl <XSLFILE> -out <OUTFILE>

*-=- STEP 1 -=-*
C:\PROGRA~1\Java\FOP-02~1.4>
xalan.bat -in c:\path\to\xml\test_MIWC_1.2.XML -xsl
c:\path\to\xsl\xml_med7_MIWC.fo -out test_MIWC_1.2.fo

*-=- STEP 2 -=-*
C:\PROGRA~1\Java\FOP-02~1.4>
xalan.bat -in c:\path\to\xml\test_MIWC_1.2.fo -xsl
c:\path\to\xsl\fo2html.xsl -out test_MIWC_1.2.html


Like the results from using FOP to transform XML to "-txt" (not really
that useful), the result is not generally desirable, however, it
provided output that was at least somewhat useful. I could certainly
tweak the output a bit and make it "pretty".

I doubt it would take much to have FOP do this (in theory at least ;-p),
but you can already use XALAN to use this, so why bother. The argument
against doing this is similar to the argument against having FOP output
the *.fo file used to output the PDF (something else for which xalan is
useful).

-- 
Clay Leeds - cleeds@medata.com
Web Developer - Medata, Inc. - http://www.medata.com
PGP Public Key: https://mail.medata.com/pgp/cleeds.asc


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


RE: HTML render class available?

Posted by Victor Mote <vi...@outfitr.com>.
Christian Neuroth wrote:

> As I am a newbie to FOP, I am not sure whether my post makes sense or not.
>
> I really enjoy working with FOP: I use one XSL-FO sheet to generate plain
> text,
> PDF and even SVG documents. The resulting docs have the same layout. Since
> the layout is very complex, we require that the layout is
> configured in only
> one
> XSL-FO stylesheet.
>
> The only thing that I am missing, is a render class for HTML as
> we are also
> in need of a HTML doc. Does anyone have a solution for this?

HTML is fundamentally different from FOP's other output formats, most of
which are paginated -- HTML is not. FOP does support MIF & RTF output
(neither of these renderers is robust right now), both of which are
structural, like HTML, but there is a big difference -- both are much more
complex than HTML, and it makes some sense to hide that complexity from
users. One could write an HTML renderer for FOP, but the results would
probably not be satisfactory. It really makes more sense to use a separate
transformation to convert your XML directly to HTML. This will, I think,
give you an order of magnitude more flexibility than anything you could get
by passing the whole thing through FOP. I think you could structure your
stylesheets to share the things that need to be common between them.

Victor Mote


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org