You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by I-Lin Kuo <ik...@hotmail.com> on 2003/03/02 13:17:48 UTC

pass parameters to internal pipeline

Is it possible to pass parameters to an internal pipeline?

This doesn't work for me:

<map:match pattern="test/ParamToAgg.xml">
  <map:generate src="cocoon:/test/getParam.xml">
    <map:parameter name="paramTest" value="a param value 9876"/>
  </map:generate>
  <map:serialize type="xml"/>
</map:match>
<map:match pattern="test/getParam.xml">
  <map:generate src="myDev/test/dummy.xml"/>
  <map:transform src="myDev/xsl/getParam.xsl"/>
  <map:serialize type="xml"/>
</map:match>

P.S. Just to be sure that I haven't made any dumb mistakes, I've checked 
that I have a top-level xsl:param in my style sheet getParam.xsl which picks 
up the parameter from the following pipeline:

<map:match pattern="test/getParam.xml">
  <map:generate src="myDev/test/dummy.xml"/>
  <map:transform src="myDev/xsl/getParam.xsl">
    <map:parameter name="paramTest" value="1234"/>
  </map:transform>
  <map:serialize type="xml"/>
</map:match>

I-Lin Kuo, Ann Arbor, MI
Macromedia Certified ColdFusion 5.0 Advanced Developer
Sun Certified Java 2 Programmer
Ann Arbor Java Users Group (http://www.aajug.org)


_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail


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


AW: pass parameters to internal pipeline

Posted by Marco Rolappe <m_...@web.de>.
although it's a bit clumsy, you *can* use request parameters with an
internal pipeline;

 <map:match pattern="test/ParamToAgg.xml">
   <map:generate
src="cocoon:/test/getParam.xml?paramTest=a+param+value+9876"/>

   <map:serialize type="xml"/>
 </map:match>

 <map:match pattern="test/getParam.xml">
   <map:generate src="myDev/test/dummy.xml"/>
   <map:transform src="myDev/xsl/getParam.xsl"/>
   <map:serialize type="xml"/>
 </map:match>

you tell the xslt transformer to use request parameters and should then be
able to access these from within your stylesheet.

> -----Ursprüngliche Nachricht-----
> Von: cocoon-users-return-47224-m_rolappe=web.de@xml.apache.org
> [mailto:cocoon-users-return-47224-m_rolappe=web.de@xml.apache.org]Im
> Auftrag von I-Lin Kuo
> Gesendet: Sonntag, 2. März 2003 13:18
> An: cocoon-users@xml.apache.org
> Betreff: pass parameters to internal pipeline
>
>
> Is it possible to pass parameters to an internal pipeline?
>
> This doesn't work for me:
>
> <map:match pattern="test/ParamToAgg.xml">
>   <map:generate src="cocoon:/test/getParam.xml">
>     <map:parameter name="paramTest" value="a param value 9876"/>
>   </map:generate>
>   <map:serialize type="xml"/>
> </map:match>
> <map:match pattern="test/getParam.xml">
>   <map:generate src="myDev/test/dummy.xml"/>
>   <map:transform src="myDev/xsl/getParam.xsl"/>
>   <map:serialize type="xml"/>
> </map:match>
>
> P.S. Just to be sure that I haven't made any dumb mistakes, I've checked
> that I have a top-level xsl:param in my style sheet getParam.xsl
> which picks
> up the parameter from the following pipeline:
>
> <map:match pattern="test/getParam.xml">
>   <map:generate src="myDev/test/dummy.xml"/>
>   <map:transform src="myDev/xsl/getParam.xsl">
>     <map:parameter name="paramTest" value="1234"/>
>   </map:transform>
>   <map:serialize type="xml"/>
> </map:match>
>
> I-Lin Kuo, Ann Arbor, MI
> Macromedia Certified ColdFusion 5.0 Advanced Developer
> Sun Certified Java 2 Programmer
> Ann Arbor Java Users Group (http://www.aajug.org)
>
>
> _________________________________________________________________
> The new MSN 8: smart spam protection and 2 months FREE*
> http://join.msn.com/?page=features/junkmail
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>


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


Re: pass parameters to internal pipeline

Posted by Brian Johnson <jo...@yahoo.com>.
Upon a little closer examination, it appears that passing parameters to 
the source resolver will only make them available in the objectModel of 
the sitemap you are calling. I don't know if that will help you or not. 
Outside of that, it doesn't appear that there is any other mechanism to 
pass information to a sitemap source that I can see...
Brian

On Sunday, March 2, 2003, at 07:46  AM, Brian Johnson wrote:

> Ok, I see what you are trying to do... Again though, the FileGenerator 
> doesn't use any parameters that are passed to it. It is possible to 
> extend FileGenerator and override the setup method to pass parameters 
> to the source resolver. I believe this would provide the functionality 
> you are looking for.
> Brian
>
> On Sunday, March 2, 2003, at 07:29  AM, Brian Johnson wrote:
>
>> What do you want to do with this parameter? The FileGenerator doesn't 
>> use any parameters. The TraxTransformer allows you to pass parameters 
>> to the stylesheet that can be accessed with xsl:param, but there is 
>> no similar function for a generic xml document. The FileGenerator 
>> simply loads the xml document and creates SAX events from it.
>> Brian
>>
>> On Sunday, March 2, 2003, at 07:17  AM, I-Lin Kuo wrote:
>>
>>> Is it possible to pass parameters to an internal pipeline?
>>>
>>> This doesn't work for me:
>>>
>>> <map:match pattern="test/ParamToAgg.xml">
>>>  <map:generate src="cocoon:/test/getParam.xml">
>>>    <map:parameter name="paramTest" value="a param value 9876"/>
>>>  </map:generate>
>>>  <map:serialize type="xml"/>
>>> </map:match>
>>> <map:match pattern="test/getParam.xml">
>>>  <map:generate src="myDev/test/dummy.xml"/>
>>>  <map:transform src="myDev/xsl/getParam.xsl"/>
>>>  <map:serialize type="xml"/>
>>> </map:match>
>>>
>>> P.S. Just to be sure that I haven't made any dumb mistakes, I've 
>>> checked that I have a top-level xsl:param in my style sheet 
>>> getParam.xsl which picks up the parameter from the following >> 
>>> pipeline:
>>>
>>> <map:match pattern="test/getParam.xml">
>>>  <map:generate src="myDev/test/dummy.xml"/>
>>>  <map:transform src="myDev/xsl/getParam.xsl">
>>>    <map:parameter name="paramTest" value="1234"/>
>>>  </map:transform>
>>>  <map:serialize type="xml"/>
>>> </map:match>
>>>
>>> I-Lin Kuo, Ann Arbor, MI
>>> Macromedia Certified ColdFusion 5.0 Advanced Developer
>>> Sun Certified Java 2 Programmer
>>> Ann Arbor Java Users Group (http://www.aajug.org)
>>>
>>>
>>> _________________________________________________________________
>>> The new MSN 8: smart spam protection and 2 months FREE*  
>>> http://join.msn.com/?page=features/junkmail
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
>>> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
>> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>


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


Re: pass parameters to internal pipeline

Posted by Brian Johnson <jo...@yahoo.com>.
Ok, I see what you are trying to do... Again though, the FileGenerator 
doesn't use any parameters that are passed to it. It is possible to 
extend FileGenerator and override the setup method to pass parameters 
to the source resolver. I believe this would provide the functionality 
you are looking for.
Brian

On Sunday, March 2, 2003, at 07:29  AM, Brian Johnson wrote:

> What do you want to do with this parameter? The FileGenerator doesn't 
> use any parameters. The TraxTransformer allows you to pass parameters 
> to the stylesheet that can be accessed with xsl:param, but there is no 
> similar function for a generic xml document. The FileGenerator simply 
> loads the xml document and creates SAX events from it.
> Brian
>
> On Sunday, March 2, 2003, at 07:17  AM, I-Lin Kuo wrote:
>
>> Is it possible to pass parameters to an internal pipeline?
>>
>> This doesn't work for me:
>>
>> <map:match pattern="test/ParamToAgg.xml">
>>  <map:generate src="cocoon:/test/getParam.xml">
>>    <map:parameter name="paramTest" value="a param value 9876"/>
>>  </map:generate>
>>  <map:serialize type="xml"/>
>> </map:match>
>> <map:match pattern="test/getParam.xml">
>>  <map:generate src="myDev/test/dummy.xml"/>
>>  <map:transform src="myDev/xsl/getParam.xsl"/>
>>  <map:serialize type="xml"/>
>> </map:match>
>>
>> P.S. Just to be sure that I haven't made any dumb mistakes, I've 
>> checked that I have a top-level xsl:param in my style sheet 
>> getParam.xsl which picks up the parameter from the following >> pipeline:
>>
>> <map:match pattern="test/getParam.xml">
>>  <map:generate src="myDev/test/dummy.xml"/>
>>  <map:transform src="myDev/xsl/getParam.xsl">
>>    <map:parameter name="paramTest" value="1234"/>
>>  </map:transform>
>>  <map:serialize type="xml"/>
>> </map:match>
>>
>> I-Lin Kuo, Ann Arbor, MI
>> Macromedia Certified ColdFusion 5.0 Advanced Developer
>> Sun Certified Java 2 Programmer
>> Ann Arbor Java Users Group (http://www.aajug.org)
>>
>>
>> _________________________________________________________________
>> The new MSN 8: smart spam protection and 2 months FREE*  
>> http://join.msn.com/?page=features/junkmail
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
>> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>


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


Re: pass parameters to internal pipeline

Posted by Brian Johnson <jo...@yahoo.com>.
What do you want to do with this parameter? The FileGenerator doesn't 
use any parameters. The TraxTransformer allows you to pass parameters 
to the stylesheet that can be accessed with xsl:param, but there is no 
similar function for a generic xml document. The FileGenerator simply 
loads the xml document and creates SAX events from it.
Brian

On Sunday, March 2, 2003, at 07:17  AM, I-Lin Kuo wrote:

> Is it possible to pass parameters to an internal pipeline?
>
> This doesn't work for me:
>
> <map:match pattern="test/ParamToAgg.xml">
>  <map:generate src="cocoon:/test/getParam.xml">
>    <map:parameter name="paramTest" value="a param value 9876"/>
>  </map:generate>
>  <map:serialize type="xml"/>
> </map:match>
> <map:match pattern="test/getParam.xml">
>  <map:generate src="myDev/test/dummy.xml"/>
>  <map:transform src="myDev/xsl/getParam.xsl"/>
>  <map:serialize type="xml"/>
> </map:match>
>
> P.S. Just to be sure that I haven't made any dumb mistakes, I've 
> checked that I have a top-level xsl:param in my style sheet 
> getParam.xsl which picks up the parameter from the following pipeline:
>
> <map:match pattern="test/getParam.xml">
>  <map:generate src="myDev/test/dummy.xml"/>
>  <map:transform src="myDev/xsl/getParam.xsl">
>    <map:parameter name="paramTest" value="1234"/>
>  </map:transform>
>  <map:serialize type="xml"/>
> </map:match>
>
> I-Lin Kuo, Ann Arbor, MI
> Macromedia Certified ColdFusion 5.0 Advanced Developer
> Sun Certified Java 2 Programmer
> Ann Arbor Java Users Group (http://www.aajug.org)
>
>
> _________________________________________________________________
> The new MSN 8: smart spam protection and 2 months FREE*  
> http://join.msn.com/?page=features/junkmail
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>


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