You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Nesto <ne...@libero.it> on 2004/03/04 17:33:47 UTC

Cocoon and Saxon

Hi all!

I was trying to integrate the SAXON processor into Cocoon because my 
webapp needs it to carry out some transformations.
(I use Cocoon 2.1.3 under Tomcat 4.1.29 . I want to install Saxon 7.8)
My cocoon webapp runs directly under the Tomcat webapps directory.
I read some documentation and I did the following:
1) copy saxon jars into WEB-INF/lib directory;
2) I've added this code to cocoon.xconf:
    <component 
role="org.apache.cocoon.components.xslt.XSLTProcessor/Saxon" 
class="org.apache.cocoon.components.xslt.XSLTProcessorImpl" 
logger="core.xslt-processor">
        <parameter name="use-store" value="true"/>
        <parameter name="incremental-processing" value="false"/>
        <!-- the path to the transformer-factory has changed ... -->
        <parameter name="transformer-factory" 
value="net.sf.saxon.TransformerFactoryImpl"/>
    </component>

3) in my sitemap.xmap I added this under the transformers section:
            <map:transformer name="xslt-saxon" pool-grow="2" 
pool-max="32" pool-min="8" 
src="org.apache.cocoon.transformation.TraxTransformer">
                <use-request-parameters>false</use-request-parameters>
                
<use-browser-capabilities-db>false</use-browser-capabilities-db>
                
<xslt-processor-role>org.apache.cocoon.components.xslt.XSLTProcessor/Saxon</xslt-processor-role>
            </map:transformer>

4)  when I want to use saxon (normally I use the default transformer) I 
write:
            <map:transform type="xslt-saxon" 
src="transforms/X3dToVrml97.xsl"/>
(with the default xslt processor the vrml stylesheet does not transforms 
correctly)

But the problem is not in such pipeline (where the saxon processos is 
called): I get one error even in the first page of my webapp (where the 
default cocoon processor is used). Is seems like there's  a conflict, 
but I have no idea on where and why.

Please give me some hint to solve this problem.
Thanks in advance!
Best regards,
Nesto


The exception I get is:

java.lang.UnsupportedOperationException: The Saxon DOM cannot be updated 
at net.sf.saxon.om.AbstractNode.disallowUpdate(AbstractNode.java:681) at 
net.sf.saxon.om.AbstractNode.createElementNS(AbstractNode.java:876) at 
org.apache.cocoon.webapps.authentication.components.PipelineAuthenticator.authenticate(PipelineAuthenticator.java:228) 
at 
org.apache.cocoon.webapps.authentication.components.DefaultAuthenticationManager.login(DefaultAuthenticationManager.java:243) 
at 
org.apache.cocoon.webapps.authentication.acting.LoginAction.act(LoginAction.java:117) 
at 
org.apache.cocoon.components.treeprocessor.sitemap.ActTypeNode.invoke(ActTypeNode.java:152) 
at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:84) 
at 
org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:164) 
at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:108) 
at 
org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:163) 
at 
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:108) 
at 
org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:152) 
at 
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:354) 
at 
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:307) 
at org.apache.cocoon.Cocoon.process(Cocoon.java:656)

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


Re: Cocoon and Saxon

Posted by Joerg Heinicke <jo...@gmx.de>.
On 04.03.2004 17:33, Nesto wrote:

> But the problem is not in such pipeline (where the saxon processos is 
> called): I get one error even in the first page of my webapp (where the 
> default cocoon processor is used). Is seems like there's  a conflict, 
> but I have no idea on where and why.

...

> The exception I get is:
> 
> java.lang.UnsupportedOperationException: The Saxon DOM cannot be updated 
> at net.sf.saxon.om.AbstractNode.disallowUpdate(AbstractNode.java:681) at 
> net.sf.saxon.om.AbstractNode.createElementNS(AbstractNode.java:876) at 
> org.apache.cocoon.webapps.authentication.components.PipelineAuthenticator.authenticate(PipelineAuthenticator.java:228) 
> at 
> org.apache.cocoon.webapps.authentication.components.DefaultAuthenticationManager.login(DefaultAuthenticationManager.java:243) 
> at 
> org.apache.cocoon.webapps.authentication.acting.LoginAction.act(LoginAction.java:117) 

Yes, unfortunately Saxon is used in your application not only for 
processing the XSLT, but also the DOM implementation from Saxon - but 
this on is read-only. But don't ask me how to solve it :-( If nothing 
helps unpacking and repacking Saxon without the DOM implementation 
should help.

Joerg

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