cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Hinzmann <...@geeksonly.de>
Subject accessing flowscript parameters in a sitemap
Date Wed, 01 Dec 2004 20:03:42 GMT
Hi cocooners
Consider the following
I have a webapp,  where the user can upload a xmlfile (called 'uploadfile') and enter a url
(called 
'uploadurl') the webapp then transforms the uploaded xmlfile and enriches it with the url
and a 
computed value 'urn' (calculated in a flowscript).
after the flowscript is ready it calles

	'cocoon.processPipelineTo("myPipeline, valueToBeAdded, streamToGetTheResultOfTheTransformation);'

But I dont get the point, how to access my passed parameter in the pipeline?
plz help me out. thanks

flowscript:
...
function enricheXML(urnforthexml){
	var enrichedXML = java.io.ByteArrayOutputStream();
	cocoon.processPipelineTo("enricheXML", urnForTheXml, enrichedXML);
	return enrichedXML.toString();
}
...

and the sitemap:
...
<!-- ==Pattern for the XMLenrichement ====================================== -->
		 <map:match pattern="enricheXML">
                <map:generate src="{request-param:uploadfile}" />
                <map:transform src="xsl/enrichement.xsl" >
                   <map:parameter name="url" value="{request-param:uploadurl}" />

		  <!-- how do i access the  parameter passed from the flowscript? -->
                   <map:parameter name="urn" value="{request-param:urn}" />

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

...

the enrichement.xsl is :
...
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
   <xsl:output method="xml"/>
   <xsl:param name="urn" />
   <xsl:param name="url" />

   <xsl:template match="/">
     <enriched>
	<URL><xsl:value-of select="$url"/></URL>
	<URN><xsl:value-of select="$urn"/></URN>
     </enriched>
   </xsl:template>

</xsl:stylesheet>
...
-- 
Gruss Jan Hinzmann

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


Mime
View raw message