You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Stewart, Gary" <Ga...@luht.scot.nhs.uk> on 2005/11/15 16:58:30 UTC
Using Values in the XML in the Pipeline
This is probably a long shot as I haven't seen it mentioned in the documentation. Is it possible to get a particular value from a transform, say, and use that in the pipeline. Say I've got a transform that results in the XML:
<returnid>
<primary_guid>86E72DC6-7EDA-47F2-8A3F-D2DA7E121EF0</primary_guid>
</returnid>
I want to use that to either generate a using a resource call or to do a redirect (I've taken into account the redirection in pipelines note; http://cocoon.apache.org/2.1/userdocs/concepts/redirection.html). Passing that value to fetch a document (I can do that in a cinclude though so it can be part of the same pipe without starting a new generate).
It would be handy to do but my current solution would be to transform to a cinclude based on that returned document structure and carry on the pipeline to get the intended end result.
Thanks,
Gary
*****************************************************************
The information contained in this message may be confidential or
legally privileged and is intended for the addressee only, If you
have received this message in error or there are any problems,
please notify the originator immediately. The unauthorised use,
disclosure, copying or alteration of this message is
strictly forbidden.
*****************************************************************
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Using Values in the XML in the Pipeline
Posted by "g[R]eK" <gr...@bluebottle.com>.
Stewart, Gary napisaĆ(a):
> This is probably a long shot as I haven't seen it mentioned in the documentation. Is it possible to get a particular value from a transform, say, and use that in the pipeline. Say I've got a transform that results in the XML:
>
> <returnid>
> <primary_guid>86E72DC6-7EDA-47F2-8A3F-D2DA7E121EF0</primary_guid>
> </returnid>
>
> I want to use that to either generate a using a resource call or to do a redirect (I've taken into account the redirection in pipelines note; http://cocoon.apache.org/2.1/userdocs/concepts/redirection.html). Passing that value to fetch a document (I can do that in a cinclude though so it can be part of the same pipe without starting a new generate).
>
> It would be handy to do but my current solution would be to transform to a cinclude based on that returned document structure and carry on the pipeline to get the intended end result.
I think you should use XMLFile Module[1]. Just add to your cocoon.xconf
<component-instance
class="org.apache.cocoon.components.modules.input.XMLFileModule"
logger="core.modules.xml" name="primary_guid">
<file src="cocoon:/PrimaryGuidPipe"/>
</component-instance>
Then in your second pipeline you can use everywhere you want, for example:
<map:generate src="something_{primiary_guid:/returnid/primary_guid}.xml"/>
<map:transform type="xslt" src="something.xsl">
<map:parameter name="guid" value="{primiary-guid:/returnid/primary_guid}"/>
</map:transform>
[..]
Hope this helps.
--
g[R]eK