You can try this
<map:match pattern="text.xml">
<map:match type="request-parameter" pattern="style">
<map:generate src="text.xml"/>
<map:transform src="{1}"/>
<map:serialize type="xml"/>
</map:match>
<map:generate src="text.xml"/>
<map:serialize type="xml"/>
</map:match>
or
<map:match pattern="test.xml">
<map:generate src="test.xml"/>
<map:select type="request-parameter">
<map:parameter name="parameter-name" value="style"/>
<map:when test="test.xsl">
<map:transform src="test.xsl"/>
</map:when>
<map:otherwise>
</map:otherwise>
</map:select>
<map:serialize name="xml"/>
</map:match>
Best regards
Roman
yuryx wrote:
ÂÞÃù/eNet/¼¼Êõ·þÎñÊÂÒµ²¿/ϵͳ²¿/×ܼà wrote:> Hello All,
> I hava a question for sitemap
> how can i write a sitmap:
> if i request http://site/test.xml
> it will transform by default.xsl
> if i request http://site/test.xml?sytle=test.xsl
> it will transform by test.xsl
>
> Thanks
>
Try define sitemap parameter in action from request
Like:
public class MyAction extends AbstractAction {
public Map act (Redirector redirector,
SourceResolver resolver,
Map objectModel,
String source,
Parameters params) {Map sitemapParams = new HashMap();
Request request = (Request)
objectModel.get(Constants.REQUEST_OBJECT);
String mStyle=request.getParameter("style");
sitemapParams.put("style", mStyle);return sitemapParams;
}
}in sitemap:
<map:match pattern="test/*">
<map:generate type="serverpages" src="work/test/{1}.xsp"/>
<map:act type="MyAction"><map:transform src="work/test/{style}"/>
</map:act>
<map:serialize type="html"/></map:match>
Regards.
Yury.---------------------------------------------------------------------
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]>
begin:vcard n:KOZLOV;Roman tel;work:+783 12 65 85 91, +783 12 62 27 76 x-mozilla-html:FALSE org:DATAVISION CIS;PDM adr:;;Gagarina Prospect 25b;Nizhny Novgorod;;;RUSSIA version:2.1 email;internet:[EMAIL PROTECTED] title:Programmer fn:Roman KOZLOV end:vcard
--------------------------------------------------------------------- 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]>