You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by david boswell <da...@alphanumerica.com> on 2000/01/26 17:22:41 UTC

html to xml to pdf

i just recently subsribed to this list, and didn't see an answer to a
question i had in the archives.

how feasible would it be to turn html into xml and then into pdf?  the
process seems straight forward: convert html into xhtml using something
like the w3c.org's html tidy, then use xalan to convert the xhtml/xml
page into an fo page, and then turn that into pdf using fop.  i'm still
new to this, but does this sound feasible?

the only problem seems to be using a library of html presentational
markup conversions to xslfo objects -- something that turns a <b> tag,
or <i> tag, or whatever into the appriopriate xslfo markup.  is there
something available that can do this?  is creating a generic html
conversion stylesheet something that can be done?

i appreciate any help with this question.

david

Re: html to xml to pdf

Posted by Stephan Nagy <sn...@web-publicity.com>.
David Boswell wrote:

> stephan,
>
> would your fo --> html work backwards to do html --> fo?  do you know of any
> easier way to do this than the one i described originally?
>

nope it is one way only.  Works great if you have an existing fo stylesheet for
spitting out html, we started the project from scratch so we didn't have any
legacy html to convert.

-stephan



Re: html to xml to pdf

Posted by David Boswell <da...@alphanumerica.com>.
stephan,

would your fo --> html work backwards to do html --> fo?  do you know of any
easier way to do this than the one i described originally?

david

> Seems like alot of overhead to accomplish this. I'm about to release a
> package that transforms fo -> html | rtf you 'should' be able to use the
> same fo style sheet to generate pdf|html|rtf.  My transformation stuff
> would take care of the fo->html transformation and fop would take care of
> the fo->pdf transformation.  I've been talking with stefano about getting
> it added to the xml.apache.org workspace, thus the reason i subscribed to
> this and the cocoon list.  Does anyone else out there need this
> functionality?
>
> -stephan


Re: html to xml to pdf

Posted by Stephan Nagy <sn...@web-publicity.com>.
Bill Raudabaugh wrote:

> I'm definitely interested in fo -> html. I actually started work on an
> HTMLRenderer class for FOP that I was planning to finish. But it sounds like
> you are much farther along.

Sadly, it is completely seperate from fop.  I'm not real sure how much work
would be required to get it to fit into the fop architecture.

-stephan


Re: html to xml to pdf

Posted by Bill Raudabaugh <bi...@infomentum.com>.
I'm definitely interested in fo -> html. I actually started work on an
HTMLRenderer class for FOP that I was planning to finish. But it sounds like
you are much farther along.

Stephan Nagy wrote:
>
> Seems like alot of overhead to accomplish this. I'm about to release a
> package that transforms fo -> html | rtf you 'should' be able to use the
> same fo style sheet to generate pdf|html|rtf.  My transformation stuff
> would take care of the fo->html transformation and fop would take care of
> the fo->pdf transformation.  I've been talking with stefano about getting
> it added to the xml.apache.org workspace, thus the reason i subscribed to
> this and the cocoon list.  Does anyone else out there need this
> functionality?
>
> -stephan
>
>


RE: html to xml to pdf

Posted by Rich Scott <rs...@cas.org>.
Stephan

I would find it very useful to use one style sheet to transform an XML file
into html, rtf orf pdf.  That starts to give some real flexibility to the
process.

Rich Scott

> -----Original Message-----
> From: snagy@pompei.lostworld.org [mailto:snagy@pompei.lostworld.org]On
> Behalf Of Stephan Nagy
> Sent: Wednesday, January 26, 2000 11:40 AM
> To: fop-dev@xml.apache.org
> Subject: Re: html to xml to pdf
>
>
> david boswell wrote:
>
> > i just recently subsribed to this list, and didn't see an answer to a
> > question i had in the archives.
>
> I just subscribed as well.  I guess this is as good a time as any.
>
> >
> >
> > how feasible would it be to turn html into xml and then into pdf?  the
> > process seems straight forward: convert html into xhtml using something
> > like the w3c.org's html tidy, then use xalan to convert the xhtml/xml
> > page into an fo page, and then turn that into pdf using fop.  i'm still
> > new to this, but does this sound feasible?
>
> Seems like alot of overhead to accomplish this. I'm about to release a
> package that transforms fo -> html | rtf you 'should' be able to use the
> same fo style sheet to generate pdf|html|rtf.  My transformation stuff
> would take care of the fo->html transformation and fop would take care of
> the fo->pdf transformation.  I've been talking with stefano about getting
> it added to the xml.apache.org workspace, thus the reason i subscribed to
> this and the cocoon list.  Does anyone else out there need this
> functionality?
>
> -stephan
>
>


Re: html to xml to pdf

Posted by Stephan Nagy <sn...@web-publicity.com>.
Karen Artman wrote:

> I could use the fo: to html functionality. Would the transformation be based
> on the browser level or is that not necessary?
>

I'm spitting out html compliant with the 3.2 spec.  Was thinking about adding
an option to spit out html 4.0.

-stephan



Re: 3 Newbie Questions

Posted by Philip Suh <ph...@filsa.net>.
> > == 1. Trouble getting my first fo to output:                 ==
> > ==    FATAL ERROR: Root element must be root, not default FO ==
> > 
> > 	I know this is a FAQ, but I read through the archives and tried
> > everything suggested there. (It seems someone else had a similar problem,
> > but did not receive a response...
> Well, this is a bug in the release version of fop 0.12.0 and has been fixed in the cvs 
> version. Now with James disappearing in his work and the new plans for xsl 2000 I am 
> not sure when we will see a simple bug fix for the masses ;-)

Well, I've checked out the latest version using cvs and I'll have to try
my hand at compiling that... (cvs was question 3 by the way, but i found
it cvs instructions on the main xml.apache.org page)


> <fo:root xmlns:fo="http://www.w3.org/XSL/Format">
> > WARNING: Unknown formatting object http://www.w3.org/XSL/Format^root
> > FATAL ERROR: Root element must be root, not default FO
>  
> > Any ideas?
> As the faq says:  it must be:
> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
> Watch out for the 1999!

Argh! Must I make all my stupid mistakes in public? 
That was it, it just rendered fine.  Thanks for your help.
 
> I do like the idea of having some fo examples which work. BTW: I think that there are 
> working xml+xslt files in the docs subdir. 

Thanks for the tip,... I'll check it out.

By way of introducion, I'm a web developer/programmer at Organic, Inc.
While I'm relatively new to Java/FOP, our server engineers do lots of Java
server devlopment, and one of them pointed me to the xml.apache.org site.
I do have some XML experience: in June '99 we launched homedepot.com, a
website that was coded entirely in XML and output to jhtml via a
transformation engine known as xmltr.

Glad to be here, hope I can contribute as I get more up to speed with the
FO stuff.

Regards,

Phil Suh 


Re: 3 Newbie Questions

Posted by Fotis Jannidis <Fo...@lrz.uni-muenchen.de>.
Hello,
 
> I'm new to FOP, spent most of the weekend reading the archives and getting
> things installed.  I have a dealstopper and a couple questions.  I'd
> appreciate your help:
> 
> 
> == 1. Trouble getting my first fo to output:                 ==
> ==    FATAL ERROR: Root element must be root, not default FO ==
> 
> 	I know this is a FAQ, but I read through the archives and tried
> everything suggested there. (It seems someone else had a similar problem,
> but did not receive a response...
Well, this is a bug in the release version of fop 0.12.0 and has been fixed in the cvs 
version. Now with James disappearing in his work and the new plans for xsl 2000 I am 
not sure when we will see a simple bug fix for the masses ;-)

<fo:root xmlns:fo="http://www.w3.org/XSL/Format">
> WARNING: Unknown formatting object http://www.w3.org/XSL/Format^root
> FATAL ERROR: Root element must be root, not default FO
 
> Any ideas?
As the faq says:  it must be:
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
Watch out for the 1999!

I do like the idea of having some fo examples which work. BTW: I think that there are 
working xml+xslt files in the docs subdir. 

Fotis


3 Newbie Questions

Posted by Philip Suh <ph...@filsa.net>.
Hello,

I'm new to FOP, spent most of the weekend reading the archives and getting
things installed.  I have a dealstopper and a couple questions.  I'd
appreciate your help:


== 1. Trouble getting my first fo to output:                 ==
==    FATAL ERROR: Root element must be root, not default FO ==

	I know this is a FAQ, but I read through the archives and tried
everything suggested there. (It seems someone else had a similar problem,
but did not receive a response...
http://xml-archive.webweaving.org/xml-archive-fop/0292.html).

What I did:

	a. installed java, tested it, did HelloWorld
	b. downloaded xp, xt, fop_bin_0_12_0, xerces, etc.
	c. placed those files in my class path.
	d. from jtauber.com, obtained test3.fot from example page.
	e. changed 
             <fo:root xmlns:fo="http://www.w3.org/XSL/Format/1.0">
	   to
             <fo:root xmlns:fo="http://www.w3.org/XSL/Format">
	f. invoked org.fop.apps.CommandLine

What I got:

[phil]$ java -cp fop_bin_0_12_0.jar:xerces.jar:xp.jar:xt.jar
org.apache.fop.apps.CommandLine ../test3.fot ../test3.pdf

FOP 0.12.0
using SAX parser com.jclark.xml.sax.Driver
using renderer org.apache.fop.render.pdf.PDFRenderer
using element mapping org.apache.fop.fo.StandardElementMapping
using element mapping org.apache.fop.svg.SVGElementMapping
building formatting object tree
WARNING: Unknown formatting object http://www.w3.org/XSL/Format^root
FATAL ERROR: Root element must be root, not default FO

Any ideas?


== 2. Searching for sample FO files ==

Well, after that failure, I started searching for sample FO files,
thinking that the test3.fo was out of date.  I read with some excitement
the thread 'request for FOP tests', but at the end of the thread and after
I couldn't find mention of any FO repository beyond the one at renderx.com
(http://www.renderx.com/Demo/index.html).

Did I just miss it, is that sample repository around somewhere?


Thanks in advance for your help.  I appreciate your time and patience.

Phil Suh



RE: html to xml to pdf

Posted by Karen Artman <ka...@home.com>.
I could use the fo: to html functionality. Would the transformation be based
on the browser level or is that not necessary?

Karen Artman
Statement Matters

-----Original Message-----
From: snagy@pompei.lostworld.org [mailto:snagy@pompei.lostworld.org]On
Behalf Of Stephan Nagy
Sent: Wednesday, January 26, 2000 11:40 AM
To: fop-dev@xml.apache.org
Subject: Re: html to xml to pdf


david boswell wrote:

> i just recently subsribed to this list, and didn't see an answer to a
> question i had in the archives.

I just subscribed as well.  I guess this is as good a time as any.

>
>
> how feasible would it be to turn html into xml and then into pdf?  the
> process seems straight forward: convert html into xhtml using something
> like the w3c.org's html tidy, then use xalan to convert the xhtml/xml
> page into an fo page, and then turn that into pdf using fop.  i'm still
> new to this, but does this sound feasible?

Seems like alot of overhead to accomplish this. I'm about to release a
package that transforms fo -> html | rtf you 'should' be able to use the
same fo style sheet to generate pdf|html|rtf.  My transformation stuff
would take care of the fo->html transformation and fop would take care of
the fo->pdf transformation.  I've been talking with stefano about getting
it added to the xml.apache.org workspace, thus the reason i subscribed to
this and the cocoon list.  Does anyone else out there need this
functionality?

-stephan


Re: html to xml to pdf

Posted by Stephan Nagy <sn...@web-publicity.com>.
david boswell wrote:

> i just recently subsribed to this list, and didn't see an answer to a
> question i had in the archives.

I just subscribed as well.  I guess this is as good a time as any.

>
>
> how feasible would it be to turn html into xml and then into pdf?  the
> process seems straight forward: convert html into xhtml using something
> like the w3c.org's html tidy, then use xalan to convert the xhtml/xml
> page into an fo page, and then turn that into pdf using fop.  i'm still
> new to this, but does this sound feasible?

Seems like alot of overhead to accomplish this. I'm about to release a
package that transforms fo -> html | rtf you 'should' be able to use the
same fo style sheet to generate pdf|html|rtf.  My transformation stuff
would take care of the fo->html transformation and fop would take care of
the fo->pdf transformation.  I've been talking with stefano about getting
it added to the xml.apache.org workspace, thus the reason i subscribed to
this and the cocoon list.  Does anyone else out there need this
functionality?

-stephan