Re: Using draft images with fop, and catalogs.

2009-02-06 Thread Vincent Hennebert
Hi Richard,

Kerry, Richard a écrit :
 I don't particularly want to use base.
 Up to now I've been the only person here using FOP.  I have my own local
 paths hard-coded into various batch and configuration files I'm using.
 I am now trying to rearrange my project so other members of my team
 might use it.  They may have some of the files at different places
 locally.
 What I want to do is minimize the number of different places they need
 to insert their own paths.  And using the Catalog mechanism seems like a
 useful way of collecting together this type of information, at least as
 far as the two main Java programs (Saxon and Fop) are concerned.  I am
 now using Saxon in this way and would like, if possible, to use Fop
 likewise.
 
 Over on the docbook-apps list Bob Stayton has advised me that there is
 some way of doing this in Fop.  I'd apprecitate it if anyone could post
 an example of how to modify fop.bat to get this sort of functionality.

You might want to follow another route than XML catalogs. Best practice
seems to bundle everything in one project (a documentation project,
similarly to a software project). The rationale is that an XSLT
customization layer is usually designed to work with a particular
version of the DocBook XSLT stylesheets, PDF output is achieved using
a certain version of FOP, etc. To allow reproducibility of your outputs
it’s best to pack all the dependencies in the project, therefore be
independent of system upgrades, etc. Have a look at how Velocity set up
their documentation system:
http://velocity.apache.org/docbook/
In such an environment you should no longer need to use catalogs to
resolve URLs inside the FO file; you would just give a path that’s
relative to the root of the project.

Otherwise, Andreas’ suggestion of playing with base might well cover
your needs after all. You can also consider using symbolic links if
applicable.

 Appreciatively,
 Richard.

HTH,
Vincent

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



RE: Using draft images with fop, and catalogs.

2009-02-05 Thread Kerry, Richard

I don't particularly want to use base.
Up to now I've been the only person here using FOP.  I have my own local
paths hard-coded into various batch and configuration files I'm using.
I am now trying to rearrange my project so other members of my team
might use it.  They may have some of the files at different places
locally.
What I want to do is minimize the number of different places they need
to insert their own paths.  And using the Catalog mechanism seems like a
useful way of collecting together this type of information, at least as
far as the two main Java programs (Saxon and Fop) are concerned.  I am
now using Saxon in this way and would like, if possible, to use Fop
likewise.

Over on the docbook-apps list Bob Stayton has advised me that there is
some way of doing this in Fop.  I'd apprecitate it if anyone could post
an example of how to modify fop.bat to get this sort of functionality.


Appreciatively,
Richard.



 -Original Message-
 From: Andreas Delmelle [mailto:andreas.delme...@telenet.be] 
 Sent: 04 February 2009 17:40
 To: fop-users@xmlgraphics.apache.org
 Subject: Re: Using draft images with fop, and catalogs.
 
 On 04 Feb 2009, at 18:21, Kerry, Richard wrote:
 
 Hi
 
  snip /
  I notice that at the moment the filename value appears in the FO  
  file in the form url(images/drft.png) when I set  
  draft.watermark.image to images/draft.png in my custom 
 xsl file.   
  Thus I presume that the stylesheet is just copying over the  
  parameter value and putting it in url().
 
 Correct.
 
  Can someone advise how to go about doing this.  Do I need to tell  
  the XSL stylesheet to change the format of what it inserts in the  
  FO ?  Or do I need to tell FOP that it's a URL/URI and to use the  
  resolver ?
 
 Nothing special to do with the stylesheet, URIResolvers or  
 CatalogResolvers, IIC.
 FOP recognizes 'url(images/draft.png)' as a relative URI, but will  
 resolve it using the current working directory as the 
 base[*], unless  
 you use a configuration file when running FOP.
 See also: http://xmlgraphics.apache.org/fop/0.95/configuration.html
 
 In short: if you use the configuration to set the 'base' 
 option, that  
 will be the base for all relative URIs encountered in the FO 
 document.  
 If you would set it to 'file:///C:/DocBook/docbook-xsl-1.74.0/' then  
 you should get the same effect as specifying the absolute URI you  
 started with.
 
 [*] Note: there is an open Bugzilla entry ( 
 https://issues.apache.org/bugzilla/show_bug.cgi?id=46566 
   ) concerning resolution of font URLs, where it is mentioned 
 that it  
 would probably be better in line with the related RFC to use 
 the base  
 URI of the document/config file. All well and easy if that actually  
 exists as a file somewhere. As soon as the XML only exists as 
 a stream  
 or a LOB on a database, this will be next to impossible.
 
 
 HTH!
 
 Andreas
 
 -
 To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
 For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
 
 

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



Re: Using draft images with fop, and catalogs.

2009-02-05 Thread Andreas Delmelle

On 05 Feb 2009, at 15:51, Kerry, Richard wrote:



I don't particularly want to use base.
Up to now I've been the only person here using FOP.  I have my own  
local

paths hard-coded into various batch and configuration files I'm using.
I am now trying to rearrange my project so other members of my team
might use it.  They may have some of the files at different places
locally.


Hmm, this seems precisely to be an argument in favor of configuring  
FOP to use a different base URL... Other users can resolve them using  
the base in their own particular context.




What I want to do is minimize the number of different places they need
to insert their own paths.  And using the Catalog mechanism seems  
like a
useful way of collecting together this type of information, at least  
as

far as the two main Java programs (Saxon and Fop) are concerned.  I am
now using Saxon in this way and would like, if possible, to use Fop
likewise.


If you can resolve the complete URL at the XSLT stage, then it has  
nothing more to do with FOP. Note: you will then produce a FO document  
with absolute URIs, which is by definition no longer easily portable  
to other environments where the images may reside in different  
locations.
Also, the question then becomes slightly off-topic for this list, and  
belongs on Saxon's user-list.


That said, it never hurts to try it here. I'd dig in the archives, if  
I were you, since I'm almost certain that I have seen similar  
questions answered here in the past.


At any rate, fop.bat uses no particular XSLT implementation, but just  
the one that is available at runtime. Maybe it's just a matter of  
setting a JAXP system property in the command-line all the way at the  
bottom of the script.



Regards

Andreas

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



Re: Using draft images with fop, and catalogs.

2009-02-05 Thread Andreas Delmelle

On 05 Feb 2009, at 20:12, Andreas Delmelle wrote:


snip /
That said, it never hurts to try it here. I'd dig in the archives,  
if I were you, since I'm almost certain that I have seen similar  
questions answered here in the past.


Took the liberty of entering a search myself, and this one seems to  
contain some interesting pointers/links:


http://markmail.org/search/?q=list%3Afop-users%20catalog%20resolver#query 
:list%3Afop-users%20catalog%20resolver+page:2+mid:i7nvi65adokdemxu+state:results


Although they are more intended for embedded usage of FOP in another  
Java application,. they may give you /some/ idea.


Unfortunately, I've never used catalogs myself, so if there's anyone  
around that has used them before (with FOP, from the command-line), it  
would be great if they chimed in.



HTH!

Andreas

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



Re: Using draft images with fop, and catalogs.

2009-02-05 Thread Jeremias Maerki
The problem is that the URIResolver is not wired into the command-line
client, yet. Basically, we'd need to provide a command-line option
similar to the -URIRESOLVER of Xalan-J's CLI:
http://svn.apache.org/viewvc/xalan/java/trunk/src/org/apache/xalan/xslt/Process.java?view=markup

As you noticed, using URIResolvers in FOP from Java code is not problem
anymore today.

On 05.02.2009 20:34:08 Andreas Delmelle wrote:
 On 05 Feb 2009, at 20:12, Andreas Delmelle wrote:
 
  snip /
  That said, it never hurts to try it here. I'd dig in the archives,  
  if I were you, since I'm almost certain that I have seen similar  
  questions answered here in the past.
 
 Took the liberty of entering a search myself, and this one seems to  
 contain some interesting pointers/links:
 
 http://markmail.org/search/?q=list%3Afop-users%20catalog%20resolver#query 
 :list%3Afop-users%20catalog%20resolver+page:2+mid:i7nvi65adokdemxu+state:results
 
 Although they are more intended for embedded usage of FOP in another  
 Java application,. they may give you /some/ idea.
 
 Unfortunately, I've never used catalogs myself, so if there's anyone  
 around that has used them before (with FOP, from the command-line), it  
 would be great if they chimed in.
 
 
 HTH!
 
 Andreas



Jeremias Maerki


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



Using draft images with fop, and catalogs.

2009-02-04 Thread Kerry, Richard
I am using Saxon and FOP to generate PDF files from DocBook.  And I'm
using a draft image.
My customized stylesheet for DocBook-FO includes a value for the
parameter draft.watermark.image.  It is currently the full local path to
the draft.png file that I am using (ie somethiing like
C:/DocBook/docbook-xsl-1.74.0/images/draft.png)
I would like to change it to be a url (or is it a uri), probably using
the catalog resolving mechanism that is available in Saxon using the -x,
-y, -r, -u qualifiers.  
 
I notice that at the moment the filename value appears in the FO file in
the form url(images/drft.png) when I set draft.watermark.image to
images/draft.png in my custom xsl file.  Thus I presume that the
stylesheet is just copying over the parameter value and putting it in
url().
 
Can someone advise how to go about doing this.  Do I need to tell the
XSL stylesheet to change the format of what it inserts in the FO ?  Or
do I need to tell FOP that it's a URL/URI and to use the resolver ?
 
Uncertainly,
Richard.
 
 
 
 

Richard Kerry
Colledia Control Engineer
Siemens IT Solutions and Services Ltd
Room 457 Drama Building, BBC Television Centre, Wood Lane, London, W12
7RJ
T: +44 (0)20 82259063 F: +44 (0)20 8576 8182 M: +44 (0)7921 244993
Email: richard.ke...@siemens.com
blocked::mailto:richard.ke...@siemens.com 
Website:  www.siemens.co.uk/it-solutions
blocked::outbind://47/www.siemens.co.uk/it-solutions 

This e-mail contains confidential information and is for the exclusive
use of the addressee/s.  If you are not the addressee, then any
distribution, copying or use of this e-mail is prohibited. If received
in error, please advise the sender and delete it immediately.  We accept
no liability for any loss or damage suffered by any person arising from
use of this e-mail.

Siemens IT Solutions and Services Limited
Registered No: 1203466 England
Registered Office: Faraday House, Sir William Siemens Square, Frimley,
Camberley, GU16 8QD

 


Re: Using draft images with fop, and catalogs.

2009-02-04 Thread Andreas Delmelle

On 04 Feb 2009, at 18:21, Kerry, Richard wrote:

Hi


snip /
I notice that at the moment the filename value appears in the FO  
file in the form url(images/drft.png) when I set  
draft.watermark.image to images/draft.png in my custom xsl file.   
Thus I presume that the stylesheet is just copying over the  
parameter value and putting it in url().


Correct.

Can someone advise how to go about doing this.  Do I need to tell  
the XSL stylesheet to change the format of what it inserts in the  
FO ?  Or do I need to tell FOP that it's a URL/URI and to use the  
resolver ?


Nothing special to do with the stylesheet, URIResolvers or  
CatalogResolvers, IIC.
FOP recognizes 'url(images/draft.png)' as a relative URI, but will  
resolve it using the current working directory as the base[*], unless  
you use a configuration file when running FOP.

See also: http://xmlgraphics.apache.org/fop/0.95/configuration.html

In short: if you use the configuration to set the 'base' option, that  
will be the base for all relative URIs encountered in the FO document.  
If you would set it to 'file:///C:/DocBook/docbook-xsl-1.74.0/' then  
you should get the same effect as specifying the absolute URI you  
started with.


[*] Note: there is an open Bugzilla entry ( https://issues.apache.org/bugzilla/show_bug.cgi?id=46566 
 ) concerning resolution of font URLs, where it is mentioned that it  
would probably be better in line with the related RFC to use the base  
URI of the document/config file. All well and easy if that actually  
exists as a file somewhere. As soon as the XML only exists as a stream  
or a LOB on a database, this will be next to impossible.



HTH!

Andreas

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