cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alfred Nathaniel (JIRA)" <j...@apache.org>
Subject [jira] Closed: (COCOON-2165) PROCESSING BUG when using COCOON-PROTOCOL for TRANSFORMATION SRC and XSL:INCLUDE
Date Tue, 05 Feb 2008 20:31:08 GMT

     [ https://issues.apache.org/jira/browse/COCOON-2165?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Alfred Nathaniel closed COCOON-2165.
------------------------------------

    Resolution: Won't Fix

The xsl:include uses the same source resolver and default protocol used for reading the parent
stylesheet.  Therefore href="test_inc.xhtml" is interpreted as "cocoon:/test_inc.xhtml" which
is normalized to "cocoon://test/test_inc.xhtml".

To make your use case work, you have to either a) use an absolute file:protocol as in href="file:/home/user/path/to/test_inc.xhtml"
or b) add a match to your sitemap as

<map:match pattern="test_inc.xhtml">
  <map:generate src="test_inc.xhtml"/>
  <map:serialize type="xml"/>
</map:match>

Option b) is heavier as it goes once again through the Cocoon machinery for all includes but
it avoids having an absolute path in the parent stylesheet.

IIUC you try to use dynamically generated stylesheets.  I can only recommend you to look for
another way to solve your actual problem.  Dynamic stylesheets will be difficult to debug,
and you may run into problems that the stylesheets are either reloaded too often or not at
all.

If I misinterpret your intentations and you are not into dynamic stylesheets, then option
c) is even simpler:

<map:match pattern="testD.html">
  <map:generate src="test_content.xhtml"/>
  <map:transform src="test_transform.xhtml">
  <map:serialize type="html"/>
</map:match>

HTH, Alfred.

> PROCESSING BUG when using COCOON-PROTOCOL for TRANSFORMATION SRC and XSL:INCLUDE
> --------------------------------------------------------------------------------
>
>                 Key: COCOON-2165
>                 URL: https://issues.apache.org/jira/browse/COCOON-2165
>             Project: Cocoon
>          Issue Type: Bug
>          Components: * Cocoon Core
>    Affects Versions: 2.1.11
>            Reporter: Robert Hoffmann
>            Priority: Critical
>
> Hi cocoon developers,
> I found the following problem when using the cocoon-protocol in the src of map:transform,
BUT ONLY if there is an xsl:include in the transforming xsl. 
> 1)	the sitemap
>  
> <map:pipeline>
>   <!-- testA: simple transform test: WORKS -->
>   <map:match pattern="testA.html">
>    <map:generate src="test_content.xhtml"/>
>    <map:transform src="test_transform.xhtml"/>
>    <map:serialize type="html"/>
>   </map:match>
>   <!-- testB: 'dynamic' resource for test_transform.xhtml: WORKS -->
>   <!-- IMPORTANT: the include reference in 'test_transform.xhtml' causes the error!
-->
>   <!-- IMPORTANT: Remove this include reference and it works -->
>   <map:match pattern="testB.html">
>    <map:generate src="test_transform.xhtml"/>
>    <map:serialize type="xml"/>
>   </map:match>
>   <!-- testC: transform using 'dynamic' resource as transformer: FAILS -->
>   <!-- FAILS: but ONLY if there is a xsl:include reference in the transforming xsl
-->
>   <map:match pattern="testC.html">
>    <map:generate src="test_content.xhtml"/>
>    <map:transform src="cocoon:/testB.html"/>
>    <map:serialize type="html"/>
>   </map:match>
> </map:pipeline>
> 2) Exception:
> org.apache.cocoon.ProcessingException: Unable to get transformer handler for cocoon://test/testB.html?pipelinehash=2533989387103728471
> 	at [TransformerException] - file:///Users/hoffmann/local/tomcat__11080/webapps/ROOT/app/foo/test/test_transform.xhtml:11:38
> 	at <map:serialize type="html"> - file:///Users/hoffmann/local/tomcat__11080/webapps/ROOT/app/foo/test/fooTest.xmap:27:33
> 	at <map:transform> - file:///Users/hoffmann/local/tomcat__11080/webapps/ROOT/app/foo/test/fooTest.xmap:26:46
> 	at <map:generate> - file:///Users/hoffmann/local/tomcat__11080/webapps/ROOT/app/foo/test/fooTest.xmap:25:45
> 	at <map:mount> - file:///Users/hoffmann/local/tomcat__11080/webapps/ROOT/fooRootSitemap.xmap:77:92
> Complete exception stack: http://cbio.mskcc.org/~hoffmann//pub/cocoon/a/cocoon_bug_report/error.txt
> 3) I provide links to all the mentioned files at:
> a) Individual files: http://cbio.mskcc.org/~hoffmann//pub/cocoon/a/cocoon_bug_report/
> b) One archive: http://cbio.mskcc.org/~hoffmann//pub/cocoon/a/cocoon_bug_report.zip
> I hope this detailed test case will be helpful to one of the cocoon gurus...
> Many thanks!!!
> Robert
> PS: Cocoon really rocks!
> --
> Have you tried iHOP yet? http://www.ihop-net.org/UniPub/iHOP/

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message