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 Geoffrey <jc...@hotmail.com> on 2004/03/30 20:48:23 UTC

xsl:include and fop

Hi all,

1) Is it possible to use <xsl:include and/or <xsl:import entities in xsl
sheets used by FOP?
2) Is it possible to combine this with code that generates pdf (through fo)
3) (And now the real question) Is it possible to do this if your xsl are
resources of your achive, fetched by getClass().getResource("myxsl.xsl")?

For example:

InputStream xslInputStream = getClass().getResourceAsStream("myxsl.xsl");
// myxsl.xsl uses xsl:include entities, including myotherxsl.xsl etc
Source xsltSrc = new StreamSource(xslInputStream);
// Can only provide one xsl file (the root file)
TransformerFactory transformerFactory = TransformerFactory.newInstance();
Transformer transformer = transformerFactory.newTransformer(xsltSrc);
// throws exception

My application will be distributed as a jar, so thats why I want the
resources to stay resources.

Thanks for any and all help,
Geoffrey




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


Re: xsl:include and fop

Posted by Jeremias Maerki <de...@greenmail.ch>.
Not directly, but it should be no big problem to modify the FOP sources
so you can use a URIResolver. FOP is open source after all. :-) Provided
you're using FOP 0.20.5 you can start by modifying
org.apache.fop.tools.URLBuilder who's job it is to convert URIs into
URLs.

Providing support for URIResolvers is on the todo list for the
development towards version 1.0.

I hope this helps.

On 01.04.2004 21:01:03 Geoffrey wrote:
> Thank you, URIResolver worked like a charm for the uri's from XML to FO.
> I have set a custom one on the Tranformer(Factory)
> 
> I still have some uri's that need to be resolved from FO to PDF (all
> images).
> Is it also possible to place an URIResolver on FOP?


Jeremias Maerki


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


Re: xsl:include and fop

Posted by Geoffrey <jc...@hotmail.com>.
Thank you, URIResolver worked like a charm for the uri's from XML to FO.
I have set a custom one on the Tranformer(Factory)

I still have some uri's that need to be resolved from FO to PDF (all
images).
Is it also possible to place an URIResolver on FOP?

Thanks for the help!
Geoffrey

"J.Pietschmann" <j3...@yahoo.de> schreef in bericht
news:4069D335.4070505@yahoo.de...
> Geoffrey wrote:
> > 1) Is it possible to use <xsl:include and/or <xsl:import entities in xsl
> > sheets used by FOP?
> es.
>
> > 2) Is it possible to combine this with code that generates pdf (through
fo)
> Yes.
>
> > 3) (And now the real question) Is it possible to do this if your xsl are
> > resources of your achive, fetched by
getClass().getResource("myxsl.xsl")?
> Basically: yes. It may be necesary to
> - use a jar: sheme URL and/or
> - provide a custom URIResolver in order to fetch included XSL
>   sheets from the jar.
>
> J.Pietschmann




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


Re: xsl:include and fop

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Geoffrey wrote:
> 1) Is it possible to use <xsl:include and/or <xsl:import entities in xsl
> sheets used by FOP?
es.

> 2) Is it possible to combine this with code that generates pdf (through fo)
Yes.

> 3) (And now the real question) Is it possible to do this if your xsl are
> resources of your achive, fetched by getClass().getResource("myxsl.xsl")?
Basically: yes. It may be necesary to
- use a jar: sheme URL and/or
- provide a custom URIResolver in order to fetch included XSL
  sheets from the jar.

J.Pietschmann

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