cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Kuehne <akue...@yahoo.com>
Subject Re: Hand over XSL variable value - wrong list?
Date Wed, 28 Jul 2010 19:30:06 GMT
H5,

 havn't read thru this whole thread. But my quick solution would be the cinclude 
transformer. You can construct the pipleine you like to call and pass any 
paramter in the way it's most convenient for you..

Btw I would give the cinclude transformer the alias 
'pipelineInvocationTransformer' ;-)

Greetings

Andreas



----- Original Message ----
From: Steven D. Majewski <sdm7g@virginia.edu>
To: users@cocoon.apache.org
Sent: Wed, July 28, 2010 5:24:37 PM
Subject: Re: Hand over XSL variable value - wrong list?


You can't generate a pipeline parameter *within* the pipeline.
You'll have to split it into two (or more) separate pipelines.
There are several ways of doing that.
One method would be to use flowscript:

    processPipelineTo( ... ) # this step does the xslt transform and outputs the 
<file> element...
                 # returns an output stream...
                 # parse the output and grab /files/file/text() ...
    sendPage( ... )      # call 2nd pipeline adding file value as a parameter.


But maybe the OP should think about whether it's really necessary to route that 
thru the
sitemap as a parameter.  Take a look, for example, at the Zip archive serializer 
:
    http://cocoon.apache.org/2.1/userdocs/ziparchive-serializer.html

Note especially that the sources can be other pipelines, so files in the zip 
archive
can be generated on the fly.

( If what you're trying to do doesn't seem to fit into the pipeline model, 
sometimes
  you just have to rethink whether you need to "push" or "pull" . )

In the original post, it was also unclear whether the XSL variable was going to 
be
part of the output of the transform, or if the OP expected to somehow get it's 
value
as a side effect of doing the transform. The only way to get something out of 
the
transform is thru it's output -- there are no side effects.

-- Steve Majewski


On Jul 28, 2010, at 4:48 AM, Alec Bickerton wrote:

> XML is generated via a generator.
> 
> <data>
>     <name>file</name>
>     <value>Albatross</value>
>     <temp.path>/tmp/files/xyz/</temp.path>
> </data>
> 
> A transformation occurs so that the XML looks like ...
> 
> <files>
>     <file name="Albatross">/tmp/files/xyz/Albatross</file>
> </files>
> 
> Later in the pipe, and action could be to do something to the file (Compress it 
>for example)
> 
> something like <map:act type="doMagic" 
>src="{xpath:/files/file[@name='Albatross']/text()}"}>
>     ... do some other stuff...
> </map:act>
> 
> Having spoken with the OP, theyare looking for a way to pass the value of the 
>file element in the transformed XML to the
> sitemap. Maybe I've missed something obvious but I would have thought this 
>functionality would be present in the framework.
> 
> My assumption is that the DOM is held in memory somewhere after generation and 
>passed to the various transformers before
> eventually being serialised. Surely there is a way to access the content of the 
>DOM prior to serialisation. Does anyone
> know how?
> 
> Alec,
> 
> 


---------------------------------------------------------------------
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


Mime
View raw message