cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylv...@apache.org>
Subject Re: Issue with cocoon views -- Bug or correct Design?
Date Tue, 07 Dec 2004 20:37:49 GMT
Thomas Alexnat wrote:

> Dear Developers,
>
> I was asking in the cocoon user mailing list why my content is not 
> being transformed correctly, when using the cocoon default 
> pretty-print view. The answers so far pointed me to the developer 
> list, because there seems to be a misbehaviour or misunderstanding in 
> using the cocoon views concept.
>
>
> P R O B L E M
> -------------
> When calling a simple aggregated xml with the standard cocoon pretty 
> print view, it seems that cocoon calls the view transformer twice and 
> scrambles totally the output.
>
> http://localhost:8888/a?cocoon-view=pretty-content (works fine)
> http://localhost:8888/b?cocoon-view=pretty-content (scrambles xml 
> tree, calls the view xslt twice!)
>
>
> Q U E S T I O N
> ---------------
> How can I correctly get a view of the "b" matcher, by not scrambling 
> the previous included content from "a". Defining a seperate label for 
> each matcher does not seem to be a good and generic solution.
>
>
> C O D E
> -------
>
> -- test.xml --
> <test>
>    Hello World XML
> </text>
>
>
> -- sitemap.xmap -- (added to the original sitemap)
> <map:pipeline>
>     <map:match pattern="a">
>         <map:generate src="test.xml"/>
>         <map:serialize/>
>     </map:match>
> </map:pipeline>
> <map:pipeline>
>   <map:match pattern="b">
>         <map:generate src="cocoon:/a" />


Have you tried src="cocoon:raw:/a" here? "cocoon:raw" creates a new 
"naked request" where the parameters of the original request are 
ommitted, and maybe resets the view also (although I'm not sure after a 
quick look at EnvironmentWrapper).

Otherwise, the view is called twice, and the result is the 
pretty-printing of the pretty-printed version of "test.xml".

>         <map:serialize/>
>   </map:match>
> </map:pipeline>

>
>
> S Y S T E M
> -----------
> Mac OS X 10.3.6 with Cocoon 2.1.6, Dual G5, Java 1.4.2_05


Wow, dual G5? Cool...

Sylvain

-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }


Mime
View raw message