You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Wo...@cec.eu.int on 2004/03/01 15:10:03 UTC

How to set system identifier in cocoon transformer ?

Hello ,

I'm migrating my application towards cocoon. In my old code I have the code
below in which I initialize a transformer. I would like to know the
equivalent of the setSystemId method in cocoon. Is there a way to set the
system Identifier in the cocoon sitemap ? I need the system identifier to
resolver relative URLs used in my "base" stylesheet (example.xslt) which
contains a <xsl:include> tag which needs to be resolved with this system
identifier.

Javax.xml.transform.TransformerFactory tf =
javax.xml.transform.TransformerFactory.newInstance();
 URL xslUrl = new URL("/test/example.xslt");
 javax.xml.transform.stream.StreamSource aStreamSource = 
new javax.xml.transform.stream.StreamSource(xslUrl.openStream());

 aStreamSource .setSystemId("test/prodhtml/");
 javax.xml.transform.Transformer htmlTransformer =
tf.newTransformer(aStreamSource);

Thanks,

wouter

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


Re: How to set system identifier in cocoon transformer ?

Posted by Joerg Heinicke <jo...@gmx.de>.
On 01.03.2004 15:10, Wouter.DERUYCK@cec.eu.int wrote:

> Hello ,
> 
> I'm migrating my application towards cocoon. In my old code I have the code
> below in which I initialize a transformer. I would like to know the
> equivalent of the setSystemId method in cocoon. Is there a way to set the
> system Identifier in the cocoon sitemap ? I need the system identifier to
> resolver relative URLs used in my "base" stylesheet (example.xslt) which
> contains a <xsl:include> tag which needs to be resolved with this system
> identifier.
> 
> Javax.xml.transform.TransformerFactory tf =
> javax.xml.transform.TransformerFactory.newInstance();
>  URL xslUrl = new URL("/test/example.xslt");
>  javax.xml.transform.stream.StreamSource aStreamSource = 
> new javax.xml.transform.stream.StreamSource(xslUrl.openStream());
> 
>  aStreamSource .setSystemId("test/prodhtml/");
>  javax.xml.transform.Transformer htmlTransformer =
> tf.newTransformer(aStreamSource);

If I understand this correctly you want to resolve the URLs inside the 
stylesheet relative to another place than the stylesheet is located. 
This should not be possible with Cocoon AFAIK. You probably have to 
extend the TraxTransformer yourself. What's the use case of this?

Joerg

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