> From: Barbara Post [mailto:[EMAIL PROTECTED]] > > Hello, > > is this ok for your problem ? But if "style" is not specified this wouldn't > be ok. So you would have to specify a default value anyway when > submitting...
Edited version: <map:match pattern="**.xml"> <map:generate src="{1}.xml"/> <!-- Here: "request" corresponds to RequestParameterMatcher --> <map:match type="request" pattern="style"> <map:transform src="{1}.xsl"/> <map:serialize ... /> </map:match> <map:transform src="default.xsl"/> <map:serialize ... /> </map:match> Vadim > Babs > ----- Original Message ----- > From: Jo Bourne <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, July 30, 2002 4:39 AM > Subject: using request selector to choose xsl > > > > Hi, > > > > I currently have a request selector working to choose which xsl to use > based on a query string in the request. I built this using the method > recommend repeatedly in the mailing list archives and it works but I would > like it to simply test whether there is a style paramater and use it if > there is, or otherwise use the default. Having to specify each possible > stylesheet in a seperate case is annoying and wasteful. Is there another way > to do this? > > > > thanks in advance. > > Jo > > > > PS. here is an example of what I am using at present > > > > <map:match pattern="**.xml"> > > <map:generate src="{1}.xml"/> > > <map:select type="request"> > > <map:parameter name="parameter-name" value="style"/> > > <map:when test="special_one.xsl"> > > <map:transform src="special_one.xsl"/> > > </map:when> > > <map:when test="special_two.xsl"> > > <map:transform src="special_two.xsl"/> > > </map:when> > > <map:when test="special_three.xsl"> > > <map:transform src="special_three.xsl"/> > > </map:when> > > <map:otherwise> > > <map:transform src="default.xsl"/> > > </map:otherwise> > > </map:select> > > <map:serialize/> > > </map:match> --------------------------------------------------------------------- Please check that your question has not already been answered in the FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html> To unsubscribe, e-mail: <[EMAIL PROTECTED]> For additional commands, e-mail: <[EMAIL PROTECTED]>