Re: SVG image cache using a URIResolver?

2014-12-12 Thread Marc Bleron
Luis Bernardo  gmail.com> writes:

> 
> 
> Probably the URI is validated during the XML/XSL to FO transformation, 
> and the validation requires a call -- you can check that by returning an 
> invalid response. In any case, the official input for FOP is FO and the 
> caching was implemented with that in mind.
> 
> You can tweak your URIResolver to not call the DB and just return an 
> "OK" response the first time it is called for a particular URI.
> 
> You can tweak your URI resolver

Thanks for your reply.

I'll probably move towards doing the XSLT transformation in a separate step
then. The source XML data is generated on database side so performing the
transformation to FO there is an option.

Note that I've only associated the URIResolver with the FOUserAgent and
*not* with the Transformer so I'm still wondering why the URIResolver is
invoked while doing the XSLT transformation.

Regards.



-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



Re: SVG image cache using a URIResolver?

2014-12-07 Thread Luis Bernardo


Probably the URI is validated during the XML/XSL to FO transformation, 
and the validation requires a call -- you can check that by returning an 
invalid response. In any case, the official input for FOP is FO and the 
caching was implemented with that in mind.


You can tweak your URIResolver to not call the DB and just return an 
"OK" response the first time it is called for a particular URI.


You can tweak your URI resolver

On 12/5/14, 2:55 PM, Marc Bleron wrote:

Hi,

Using FOP 1.1 on Java 1.5

I have SVG images stored in a database (Oracle 11.2) which I want to include
in a PDF document.
To achieve that I've created a custom URIResolver listening to a specific
uri scheme, and used that uri as source for fo:external-graphics, e.g.


   
 
   


While transforming and rendering the output document, the URIResolver then
issues the corresponding query against the db using the cache-id value and
returns a StreamSource. That works fine.

The "problem" is that the URIResolver (and therefore the db) is called twice
when building the PDF document : once when transforming my input XML into FO
and another time when rendering the PDF from the FO.

My question is : is that intended behaviour? Isn't the caching mechanism
supposed to work in this situation?
Just want to be sure.

When using a FO object directly (identity transformation), the URIResolver
is called only once.

Thanks for any pointers.

Marc.



-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]




-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]