You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Java Developer <de...@yahoo.com> on 2004/06/29 06:00:33 UTC

Cocoon: Two generators in pipeline

Hi All, 

I am using cocoon with xsl and struts1.1

In one of the user request our webapp (<map:match pattern="blah/**.*">)

1. Generates the xml 
2. Transform the generated xml using some xsls into image, and saves
it.
3. Now it needs the orignially generated xml(at step no. 1) inorder to
paint the html page properly.  

Since the original xml has been changed after under going  many
transformations, i tried to use generator tag again in the same match,
but it doesn't work. 

There should be a simpler way to get the original xml in the middle of
processing..pls suggest me. 





=====
- Java Developer

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Re: Cocoon: Two generators in pipeline

Posted by Tony Butterfield <ta...@1060.org>.
Please excuse my off-list response but I could help but suggest you take
a look at NetKernel (www.1060.org) - I expect you're committed to using
Cocoon but looking at things from another angle can sometimes offer
insight.

The problem you have encountered is due to the strict linear pipeline
model of cocoon. Using DPML (see
http://www.1060research-server-1.co.uk/docs/1.3.0/book/xmldev/doc_guide_xml_technologies_menu_dpml.html)
you could write a pipeline like such:

<seq>

  <instr><type>generate-whatever</type>
    <target>var:original-xml</target>
  </instr>

  <instr><type>xslt</type>
    <operator>mytransform.xsl</operator>
    <operand>var:original-xml</operand>
    <target>var:transformed</target>
  </instr>

  <!-- render page with transformed xml and original 
       for example by using xslt again -->

  <instr><type>xslt</type>
    <operator>render_page.xsl</operator>
    <operand>var:transformed</operand>
    <original>var:original-xml</original> <!-- passed to xslt as a named
parameter -->
    <target>this:response</target>
  </instr>

It should say that NetKernel has no struts support but has other
technologies which are similarish - XRL
(http://www.1060research-server-1.co.uk/docs/1.3.0/book/xmldev/doc_guide_xml_technologies_menu_xrl.html)

Good luck with you development,

Tony

-- 
Tony Butterfield <ta...@1060.org>
1060 Research


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


Re: Cocoon: Two generators in pipeline

Posted by Upayavira <uv...@upaya.co.uk>.
Java Developer wrote:

>Hi All, 
>
>I am using cocoon with xsl and struts1.1
>
>In one of the user request our webapp (<map:match pattern="blah/**.*">)
>
>1. Generates the xml 
>2. Transform the generated xml using some xsls into image, and saves
>it.
>3. Now it needs the orignially generated xml(at step no. 1) inorder to
>paint the html page properly.  
>
>Since the original xml has been changed after under going  many
>transformations, i tried to use generator tag again in the same match,
>but it doesn't work. 
>
>There should be a simpler way to get the original xml in the middle of
>processing..pls suggest me. 
>  
>
My question is why do you want to do this? In a multithreaded 
environment, writing to disc can be risky, as you need to ensure that 
you aren't writing to the disc at the same time as another user. Knowing 
more of your use-case would help in identifying the best way to achieve 
this.

Oh, and if you're willing to tell us your name, that would be nice!

Regards, Upayavira



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


Re: Cocoon: Two generators in pipeline

Posted by go...@osmosis.gr.

try to aggregate 2 pipeline matches

	<map:match pattern="out/*.xml">
		<map:aggregate element="page">
			<map:part src="cocoon://trans/{1}.xml"/>
			<map:part src="cocoon://xml/{1}.xml"/>
		</map:aggregate>
		<map:transform/>
		<map:serialize/>
	</map:match>
	<map:match pattern="trans/*.xml">
		<map:generate src="{1}.xml"/>
		<map:transform/>
		<map:serialize type="xml"/>
	</map:match>
	<map:match pattern="xml/*.xml">
		<map:generate src="{1}.xml"/>
		<map:serialize type="xml"/>
	</map:match>

--stavros


On Mon, 28 Jun 2004, Java Developer wrote:

> Hi All, 
> 
> I am using cocoon with xsl and struts1.1
> 
> In one of the user request our webapp (<map:match pattern="blah/**.*">)
> 
> 1. Generates the xml 
> 2. Transform the generated xml using some xsls into image, and saves
> it.
> 3. Now it needs the orignially generated xml(at step no. 1) inorder to
> paint the html page properly.  
> 
> Since the original xml has been changed after under going  many
> transformations, i tried to use generator tag again in the same match,
> but it doesn't work. 
> 
> There should be a simpler way to get the original xml in the middle of
> processing..pls suggest me. 
> 
> 
> 
> 
> 
> =====
> - Java Developer
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 


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