You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Ali Mesbah <al...@West.NL> on 2003/06/05 10:56:11 UTC

internal pipeline

Hi all,
I have a problem and don't know if it is a bug in Cocoon or if I'm doing
something wrong. 

What I have is a pipeline which transforms an XML (source) file into an XSLT
(target) stylesheet:

<map:match pattern="xms/test">
  <map:generate src="xms/resources/combined.xml"/>
  <map:transform src="xms/styles/Meta_output.xsl"/>
  <map:serialize type="xml"/>
</map:match>


now I'd like to use the output as the source of another pipeline:

<map:match pattern="view/*">
  <map:generate src="xms/resources/{1}.xml"/>
  <map:transform src="cocoon:/xms/test"/>
  <map:serialize type="html"/>
</map:match>


I don't get any errors but the HTML output of the "view" pipeline is not the
expected (I have checked the output of the first pipeline and that is correct. I
assume it has something to do with the way I use "cocoon:/..." as the source of
the second transformer). Any ideas?

Thanks,

-- 
-- Ali Mesbah, West Consulting B.V., www.west.nl, +31 15 2191600

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


Re: internal pipeline

Posted by Andreas Hartmann <an...@apache.org>.
Ali Mesbah wrote:

[...]

>>You can try to set the log level to DEBUG and look at the sitemap
>>log to see if the correct steps are executed.
> 
> No. There is a major difference between the log information when the "xms/test"
> pipeline is called directly and when it is called by the second pipeline through
> the Cocoon: protocol. 
> I even added a LOG Transformer after the first pipeline; when using Cocoon:
> protocol, this log file remains empty:
> ([setup] ---------------------------- [Thu Jun 05 11:59:01 CEST 2003] ------)
> 
> while when called directly it is filled by all the right steps.

This is strange ...

>>The next debugging step could be to save the output of your first
>>pipeline as an XSLT file and to use this directly without the
>>cocoon: protocol.
> 
> Did that too. And indeed when I save the output of the first pipeline and use it
> as a normal source for the second (view) pipeline it goes as wished. 
> 
> So I think my assumption was correct that it has to do with the use of the
> Cocoon: protocol as the src of a transformer. Have you ever by the way used it in
> this way too (Cocoon: as the src of XSLT (not XSP) via pipelines)? 

Yes, what I meant is that I used an XSP to generate XSLT that was used
in a transformation step, e.g., somethink like:

<map:match pattern="my-xslt">
   <map:generate type="xsp" src="xslt.xsp"/>
   <map:serialize type="xml"/>
</map:match>

<map:match pattern="page">
   <map:generate src="page.xml"/>
   <map:transform src="cocoon:/my-xslt"/>
   <map:serialize/>
</map:match>

This worked perfectly, at least with Cocoon 2.1 M1
(I used it to prototype a transformer).

Sorry I can't help you, the only thing I could suggest is
to try it with 2.1-M1 or later if you're using 2.0.?.

Andreas



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


Re: internal pipeline

Posted by Ali Mesbah <al...@West.NL>.
Andreas,

As quoted from Andreas Hartmann <an...@apache.org>:
> Hi Ali,
> 
> Ali Mesbah wrote:
> 
> >Hi all,
> >I have a problem and don't know if it is a bug in Cocoon or if I'm doing
> >something wrong. 
> >
> >What I have is a pipeline which transforms an XML (source) file into an 
> >XSLT
> >(target) stylesheet:
> >
> ><map:match pattern="xms/test">
> >  <map:generate src="xms/resources/combined.xml"/>
> >  <map:transform src="xms/styles/Meta_output.xsl"/>
> >  <map:serialize type="xml"/>
> ></map:match>
> >
> >
> >now I'd like to use the output as the source of another pipeline:
> >
> ><map:match pattern="view/*">
> >  <map:generate src="xms/resources/{1}.xml"/>
> >  <map:transform src="cocoon:/xms/test"/>
> >  <map:serialize type="html"/>
> ></map:match>
> >
> >
> >I don't get any errors but the HTML output of the "view" pipeline is not 
> >the
> >expected (I have checked the output of the first pipeline and that is 
> >correct. I
> >assume it has something to do with the way I use "cocoon:/..." as the 
> >source of
> >the second transformer). Any ideas?
> 
> Your pipelines look OK (if I didn't miss anything). You're using
> the cocoon: protocol correctly. I also tried this kind of "stylesheet
> generation" (using XSP) and it worked very well. So I guess your
> problem is somewhere in the last transformation step.
> 
> You can try to set the log level to DEBUG and look at the sitemap
> log to see if the correct steps are executed.

No. There is a major difference between the log information when the "xms/test"
pipeline is called directly and when it is called by the second pipeline through
the Cocoon: protocol. 
I even added a LOG Transformer after the first pipeline; when using Cocoon:
protocol, this log file remains empty:
([setup] ---------------------------- [Thu Jun 05 11:59:01 CEST 2003] ------)

while when called directly it is filled by all the right steps.

> The next debugging step could be to save the output of your first
> pipeline as an XSLT file and to use this directly without the
> cocoon: protocol.

Did that too. And indeed when I save the output of the first pipeline and use it
as a normal source for the second (view) pipeline it goes as wished. 

So I think my assumption was correct that it has to do with the use of the
Cocoon: protocol as the src of a transformer. Have you ever by the way used it in
this way too (Cocoon: as the src of XSLT (not XSP) via pipelines)? 

> HTH,
> Andreas

-- 
-- Ali Mesbah, West Consulting B.V., www.west.nl, +31 15 2191600

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


Re: internal pipeline

Posted by Andreas Hartmann <an...@apache.org>.
Hi Ali,

Ali Mesbah wrote:

> Hi all,
> I have a problem and don't know if it is a bug in Cocoon or if I'm doing
> something wrong. 
> 
> What I have is a pipeline which transforms an XML (source) file into an XSLT
> (target) stylesheet:
> 
> <map:match pattern="xms/test">
>   <map:generate src="xms/resources/combined.xml"/>
>   <map:transform src="xms/styles/Meta_output.xsl"/>
>   <map:serialize type="xml"/>
> </map:match>
> 
> 
> now I'd like to use the output as the source of another pipeline:
> 
> <map:match pattern="view/*">
>   <map:generate src="xms/resources/{1}.xml"/>
>   <map:transform src="cocoon:/xms/test"/>
>   <map:serialize type="html"/>
> </map:match>
> 
> 
> I don't get any errors but the HTML output of the "view" pipeline is not the
> expected (I have checked the output of the first pipeline and that is correct. I
> assume it has something to do with the way I use "cocoon:/..." as the source of
> the second transformer). Any ideas?

Your pipelines look OK (if I didn't miss anything). You're using
the cocoon: protocol correctly. I also tried this kind of "stylesheet
generation" (using XSP) and it worked very well. So I guess your
problem is somewhere in the last transformation step.

You can try to set the log level to DEBUG and look at the sitemap
log to see if the correct steps are executed.

The next debugging step could be to save the output of your first
pipeline as an XSLT file and to use this directly without the
cocoon: protocol.

HTH,
Andreas



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