cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeroen Reijn" <j.re...@hippo.nl>
Subject RE: selecting transform xsl based on document id
Date Tue, 31 Aug 2004 16:28:57 GMT
Hi Pratik,
 
to get the result you want, you could use the parameter selector:

<map:match pattern="test/*/*/*">
  <map:generate src="test.xml"/>
  <map:select type="parameter">
    <map:parameter name="parameter-selector-test" value="{1}"/>
    <map:when test="act"> 
      <map:transform src="xslt/a.xsl"/> 
    </map:when> 
    <map:when test="def"> 
      <map:transform src="xslt/b.xsl"/> 
    </map:when> 
    <map:otherwise> 
      <map:transform src="xslt/default.xsl"/> 
    </map:otherwise> 
  </map:select>
<map:serialize type="xml"/>

This same answer can be found in the original cocoon documentation:

http://cocoon.apache.org/2.1/userdocs/selectors/parameter-selector.html

Greetz,

Jeroen

-----Original Message-----
From: Pratik Das [mailto:PratikD@skytechsolutions.co.in]
Posted At: Tuesday, August 31, 2004 1:59 PM
Posted To: Cocoon User List
Conversation: selecting transform xsl based on document id
Subject: selecting transform xsl based on document id
Importance: High



Can I set up a pipeline so that I can select the transform xsl based on  a wild card match
of document id or any part of url. I want something 
like this: 
<map:match pattern="lenyabody-*/*/*/*/**"> 
       <map:aggregate .... 
        <map:select pattern="*" > 
         <map:when test="act"> 
            <map:transform src="xslt/a.xsl"/> 
         </map:when> 
         <map:when test="def"> 
            <map:transform src="xslt/b.xsl"/> 
         </map:when> 
         <map:when test="ghy"> 
            <map:transform src="xslt/c.xsl"/> 
         </map:when> 
         <map:otherwise> 
            <map:transform src="xslt/default.xsl"/> 
         </map:otherwise> 
      </map:match> 

regards 
Pratik


Mime
View raw message