>Date: Tue, 11 Dec 2001 17:07:54 -0800 >To: [EMAIL PROTECTED] >From: Marie Brandt <[EMAIL PROTECTED]> >Subject: passing sitemap parameters inside of a pipeline > >I am attempting to use an XSP page generator to setup a sitemap parameter >which will then be used in the xslt tranformer statement to >determine which stylesheet to apply. However, even though I have debugged >the placement of the parameter into the result Map, I never >see the value take affect in the transformer. Consequently, to help >debug, I have tried to just pass it to my standard stylesheet and >then print it, so I can see the value is set. The sitemap parameter >nextXslt is apparently not setup and I can't figure out why?? > >Do you see anything wrong with my technique? > >(Note, I pass the generator a parameter, just to expose the parameter name >to the sitemap developer.) > > <map:match pattern="xtragate/dataService"> > <map:act set="xtragate_xspconfig"> > <map:generate type="serverpages" > src="docs/xsp/xgconfig/DataServiceXmlAbleAction.xsp"> > <map:parameter name="inputParm" value="nextXslt"/> > </map:generate> > <map:transform src="stylesheets/xgconfig/html/ds.xsl"> > <map:parameter name="inputParm" > value="{nextXslt}"/> > </map:transform> > <map:serialize type="html"/> > </map:act> > </map:match> > >In the XSP page, I simulate an action class and then setup a sitemap >parameter by putting the parameter in the result MAP object, >where parmName contains the string "nextXslt" ... Then, as you can see >below, I call the method act_DataAction which is simulating >the action class. Is there something else I need to do to expose the >resulting Map object to the sitemap? > > >... > public Map act_DataAction(Redirector redirector, SourceResolver > resolver, Map objectModel, String src, Parameters par) throws Exception { > > Map result = new HashMap(); > > String parmName = ""; > > // See if any parameters are passed in - we are looking > for the next xslt page name > // The only reason to pass in the parameter name like > this, is just to expose it to the sitemap, so the > // developer can have control of the parameter name from > there. The XSP page could just set the parameter > // in the sitemap without going through this step. It > adds some flexibility and some exposure of parameter names. > > String [] parArray = par.getNames(); > System.err.println("\nDebugMsg:act_DataAbleAction.act:The > parArray.length "+parArray.length+"\n"); > int count = parArray.length; > > if (count > 0) { > // Assume the first parameter is the xslt page > control parameter. > String parm1 = parArray[count-1]; > parmName = par.getParameter(parm1); > System.err.println("\nDebugMsg:act_DataAction.act:The > parArray value "+parArray[count-1]+"\n"); > } > > // Left out stuff to setup dsObject . > result.put(parmName,dsObject.getType()); > return result; > } >... ><page> > <xsp:logic> > Node xmlOut = null; > try{ > >act_DataAction(null,this.resolver,this.objectModel,this.source,this.parameters); > xmlOut = getDomNode(); > }catch(Exception e){ > e.printStackTrace(); > } > </xsp:logic> > > <xsp:expr>xmlOut > </xsp:expr> > > </page> > >Thanks for any help or insights!! > > >
--------------------------------------------------------------------- Please check that your question has not already been answered in the FAQ before posting. <http://xml.apache.org/cocoon/faqs.html> To unsubscribe, e-mail: <[EMAIL PROTECTED]> For additional commands, e-mail: <[EMAIL PROTECTED]>