Werner,

You'll need to use a selector to do this, parameter selector works well. Try something like this:

<map:match pattern="something.*">
<map:generate src="something.xml"/>
<map:select type="parameter">
<map:parameter name="parameter-selector-test" value="{1}"/>

<map:when test="pdf">
<map:transform src="xml2fo.xsl"/>
<map:serialize type="fo2pdf"/>
</map:when>

<map:when test="png">
<map:transform src="xml2svg.xsl"/>
<map:serialize type="svg2png"/>
</map:when>

<map:otherwise>
<map:transform src="xml2html.xsl"/>
<map:serialize type="html"/>
</map:otherwise>

</map:select>
</map:match>


On Monday, November 4, 2002, at 10:40 AM, Werner Guttmann wrote:

Hi,

is it actually possible to select a serializer based on a regexp in the
URI, iow something similar to the following sitemap fragment

<map:pipeline>
<map:match type="wildcard"
pattern="publish/instruction-controller.html">
<map:generate type="serverpages"
src="xml/instruction-controller.xml" />
<map:match type="sessionstate" pattern="*">
<map:parameter name="attribute-name" value="stylesheet"/>
<map:transform src="xsl/{1}.html.xsl" />
</map:match>
<map:serialize type="html"/>
</map:match>
</map:pipeline>

which I'd like to replace

<map:pipeline>
<map:match type="wildcard" pattern="publish/instruction-controller.*">

<map:generate type="serverpages"
src="xml/instruction-controller.xml" />
<map:match type="sessionstate" pattern="*">
<map:parameter name="attribute-name" value="stylesheet"/>
<map:transform src="xsl/{1}.html.xsl" />
</map:match>
<map:serialize type="{1}"/>
</map:match>
</map:pipeline>

Trying this results into the following exception:

org.apache.avalon.framework.configuration.ConfigurationException: Type
'{1}' is not defined for 'serialize' at
file:/ms/user/g/guttmanw/workdir/build/expiry-webapp/ sitemap.xmap:488:32

Or am I approaching this in a wrong way anyhow ?

Werner

---------------------------------------------------------------------
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]>

Reply via email to