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 Simon Pepping <sp...@leverkruid.nl> on 2005/12/04 16:15:45 UTC

Fw: Using Docbook stylesheets in FOP

I meant to cross-post this from fop-dev to fop-user but forgot it.

----- Forwarded message from Simon Pepping <sp...@leverkruid.nl> -----

On Fri, Dec 02, 2005 at 01:58:39PM +0100, Jeremias Maerki wrote:
> 
> On 02.12.2005 13:39:53 Adam Strzelecki wrote:
> > Hello Jeremias,
> > 
> > 3) Last thing I would really appreciate is I would love to generate PDF
> > directly from XML files using stylesheets but FOP XSLT routine is
> > somehow broken so I need to do the conversion with XSLTPROC which does
> > it without the problem.
> > 
> > This is the error when I use FOP with:
> > fop -xml myfile.xml -xsl docbook/fo/docbook.xsl -pdf myfile.pdf
> > 
> > Compiler warnings:
> >   file:/c:/Program%20Files/fop/docbook/fo/formal.xsl: line 433:
> > Attribute 'border-left-style' outside of element.
> >   file:/c:/Program%20Files/fop/docbook/fo/formal.xsl: line 434:
> > Attribute 'border-right-style' outside of element.
> >   file:/c:/Program%20Files/fop/docbook/fo/formal.xsl: line 435:
> > Attribute 'border-top-style' outside of element.
> >   file:/c:/Program%20Files/fop/docbook/fo/formal.xsl: line 436:
> > Attribute 'border-bottom-style' outside of element.
> > ERROR:  'Syntax error in '* or $generate.index != 0'.'
> > FATAL ERROR:  'Could not compile stylesheet'
> > Exception
> > javax.xml.transform.TransformerConfigurationException: Could not compile
> > stylesheet
> > 
> > Problem is in the XSL file of DocBook XLS 1.69.1 sheets:
> > docbook/fo/autotoc.xsl
> 
> Sounds more like a problem in either the stylesheet itself or in Xalan
> which FOP calls for doing XSLT. Maybe I should finally install DocBook
> on my machine. :-)

It is indeed not really a FOP issue.

The docbook stylesheets seem to be a pain for most XSLT
processors. Restricting myself to Java XSLT processors, I
have only been successful with Saxon6. Xalan and the Xalan processor
built into Java 5 cannot compile the docbook/fo stylesheets.

This can be achieved by putting saxon.jar first in the classpath. It
must come before xalan.jar, in order to configure the Transformer
factory to use Saxon. Unfortunately, this is not possible with the
current fop shell script, because it puts the CLASSPATH variable at
the end of the class path. (Sometimes this is what you want, here
it is not.) The fop.bat batch file ignores the CLASSPATH variable
completely.

Another issue I have with FOP and Docbook is that FOP out of the box
does not use catalogs. I think we should do something about this. It
is unrealistic to expect Docbook users to write their own startup Java
file. They want something that works from the command line. But before
we try, it would be useful to hear how other people use FOP with
Docbook.

Simon

-- 
Simon Pepping
home page: http://www.leverkruid.nl


----- End forwarded message -----

-- 
Simon Pepping
home page: http://www.leverkruid.nl


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


Re: Using Docbook stylesheets in FOP

Posted by Glen Mazza <gm...@apache.org>.
If you do this, I would recommend placing these options in the <fop/> 
Ant task first, and then at the command-line.

Glen

Jeremias Maerki wrote:
> Hey, guys, it's only a two hour job to add support for setting an
> EntityResolver and a URIResolver in FOP's command-line. Today, even FOP
> itself can use the Commons Resolver to resolve image URIs.
> 
> On 05.12.2005 20:55:35 Simon Pepping wrote:
> 
>>On Sun, Dec 04, 2005 at 12:42:26PM -0500, Glen Mazza wrote:
>>
>>>Simon Pepping wrote:
>>>
>>>
>>>>Another issue I have with FOP and Docbook is that FOP out of the box
>>>>does not use catalogs. 
>>>
>>><ignorance/> I'm unsure what you mean by catalogs.
>>
>>See http://www.oasis-open.org/committees/entity/ and
>>http://xml.apache.org/commons/components/resolver/index.html. It
>>allows you to have the DTDs, schemas and included stylesheets at
>>another path than the documents mention as the system identifier or
>>URL. Catalogs map Public Identifiers (of DTDs) and the starting string
>>of URLs to actual paths. The Debian XML system is completely based on
>>it. It is not really easy to set up, but once done, it provides a
>>robust XML system.
>> 
>>
>>>>I think we should do something about this. It
>>>>is unrealistic to expect Docbook users to write their own startup Java
>>>>file. They want something that works from the command line. 
>>>
>>>With my job, we use Ant build scripts for online PDF and HTML help 
>>>sites.  Our technical writer rather easily works with the build.xml, 
>>>understands its contents pretty well and knows how to modify it when 
>>>needed.  (She uses JEdit for editing the XML and to activate the build 
>>>scripts, but I have been thinking of having her try Eclipse because it 
>>>has better CVS functionality.)
>>>
>>>IMHO document publishing has too many moving parts to remember 
>>>everything on the command-line.  Also, there are many aspects common 
>>>(CSS stylesheets, FOP customization layer overrides, etc.) for 
>>>publishing multiple documents that can be factored out and shared in the 
>>>build script.  As a bonus, Ant can also take care of other portions of 
>>>the publishing pipeline, such as FTP'ing the results to the website when 
>>>everything is done.
>>
>>That is a rather professional solution. Lacking a good GUI, I would
>>like to see a simple command be sufficient to print a Docbook article
>>or book to say PDF. Well, on fop-dev it was just said that FOP's
>>command line 'fop -xml ... -xsl ... -pdf ...' now works for docbook
>>files with Xalan 2.7.0. That is a step forward. Still, no catalogs are
>>used.
>>
>>See here for an effort towards a GUI for this kind of task:
>>http://sourceforge.net/project/showfiles.php?group_id=54378.
>>Unfortunately, the project has been discontinued.
> 
> 
> 
> 
> Jeremias Maerki
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 
> 

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


Re: Using Docbook stylesheets in FOP

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Hey, guys, it's only a two hour job to add support for setting an
EntityResolver and a URIResolver in FOP's command-line. Today, even FOP
itself can use the Commons Resolver to resolve image URIs.

On 05.12.2005 20:55:35 Simon Pepping wrote:
> On Sun, Dec 04, 2005 at 12:42:26PM -0500, Glen Mazza wrote:
> > Simon Pepping wrote:
> > 
> > >
> > >Another issue I have with FOP and Docbook is that FOP out of the box
> > >does not use catalogs. 
> > 
> > <ignorance/> I'm unsure what you mean by catalogs.
> 
> See http://www.oasis-open.org/committees/entity/ and
> http://xml.apache.org/commons/components/resolver/index.html. It
> allows you to have the DTDs, schemas and included stylesheets at
> another path than the documents mention as the system identifier or
> URL. Catalogs map Public Identifiers (of DTDs) and the starting string
> of URLs to actual paths. The Debian XML system is completely based on
> it. It is not really easy to set up, but once done, it provides a
> robust XML system.
>  
> > >I think we should do something about this. It
> > >is unrealistic to expect Docbook users to write their own startup Java
> > >file. They want something that works from the command line. 
> > 
> > With my job, we use Ant build scripts for online PDF and HTML help 
> > sites.  Our technical writer rather easily works with the build.xml, 
> > understands its contents pretty well and knows how to modify it when 
> > needed.  (She uses JEdit for editing the XML and to activate the build 
> > scripts, but I have been thinking of having her try Eclipse because it 
> > has better CVS functionality.)
> > 
> > IMHO document publishing has too many moving parts to remember 
> > everything on the command-line.  Also, there are many aspects common 
> > (CSS stylesheets, FOP customization layer overrides, etc.) for 
> > publishing multiple documents that can be factored out and shared in the 
> > build script.  As a bonus, Ant can also take care of other portions of 
> > the publishing pipeline, such as FTP'ing the results to the website when 
> > everything is done.
> 
> That is a rather professional solution. Lacking a good GUI, I would
> like to see a simple command be sufficient to print a Docbook article
> or book to say PDF. Well, on fop-dev it was just said that FOP's
> command line 'fop -xml ... -xsl ... -pdf ...' now works for docbook
> files with Xalan 2.7.0. That is a step forward. Still, no catalogs are
> used.
> 
> See here for an effort towards a GUI for this kind of task:
> http://sourceforge.net/project/showfiles.php?group_id=54378.
> Unfortunately, the project has been discontinued.



Jeremias Maerki


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


Re: Fw: Using Docbook stylesheets in FOP

Posted by Simon Pepping <sp...@leverkruid.nl>.
On Sun, Dec 04, 2005 at 12:42:26PM -0500, Glen Mazza wrote:
> Simon Pepping wrote:
> 
> >
> >Another issue I have with FOP and Docbook is that FOP out of the box
> >does not use catalogs. 
> 
> <ignorance/> I'm unsure what you mean by catalogs.

See http://www.oasis-open.org/committees/entity/ and
http://xml.apache.org/commons/components/resolver/index.html. It
allows you to have the DTDs, schemas and included stylesheets at
another path than the documents mention as the system identifier or
URL. Catalogs map Public Identifiers (of DTDs) and the starting string
of URLs to actual paths. The Debian XML system is completely based on
it. It is not really easy to set up, but once done, it provides a
robust XML system.
 
> >I think we should do something about this. It
> >is unrealistic to expect Docbook users to write their own startup Java
> >file. They want something that works from the command line. 
> 
> With my job, we use Ant build scripts for online PDF and HTML help 
> sites.  Our technical writer rather easily works with the build.xml, 
> understands its contents pretty well and knows how to modify it when 
> needed.  (She uses JEdit for editing the XML and to activate the build 
> scripts, but I have been thinking of having her try Eclipse because it 
> has better CVS functionality.)
> 
> IMHO document publishing has too many moving parts to remember 
> everything on the command-line.  Also, there are many aspects common 
> (CSS stylesheets, FOP customization layer overrides, etc.) for 
> publishing multiple documents that can be factored out and shared in the 
> build script.  As a bonus, Ant can also take care of other portions of 
> the publishing pipeline, such as FTP'ing the results to the website when 
> everything is done.

That is a rather professional solution. Lacking a good GUI, I would
like to see a simple command be sufficient to print a Docbook article
or book to say PDF. Well, on fop-dev it was just said that FOP's
command line 'fop -xml ... -xsl ... -pdf ...' now works for docbook
files with Xalan 2.7.0. That is a step forward. Still, no catalogs are
used.

See here for an effort towards a GUI for this kind of task:
http://sourceforge.net/project/showfiles.php?group_id=54378.
Unfortunately, the project has been discontinued.

Simon

-- 
Simon Pepping
home page: http://www.leverkruid.nl


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


Re: Fw: Using Docbook stylesheets in FOP

Posted by Glen Mazza <gm...@apache.org>.
Simon Pepping wrote:

> 
> Another issue I have with FOP and Docbook is that FOP out of the box
> does not use catalogs. 

<ignorance/> I'm unsure what you mean by catalogs.

> I think we should do something about this. It
> is unrealistic to expect Docbook users to write their own startup Java
> file. They want something that works from the command line. 

With my job, we use Ant build scripts for online PDF and HTML help 
sites.  Our technical writer rather easily works with the build.xml, 
understands its contents pretty well and knows how to modify it when 
needed.  (She uses JEdit for editing the XML and to activate the build 
scripts, but I have been thinking of having her try Eclipse because it 
has better CVS functionality.)

IMHO document publishing has too many moving parts to remember 
everything on the command-line.  Also, there are many aspects common 
(CSS stylesheets, FOP customization layer overrides, etc.) for 
publishing multiple documents that can be factored out and shared in the 
build script.  As a bonus, Ant can also take care of other portions of 
the publishing pipeline, such as FTP'ing the results to the website when 
everything is done.

Glen

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