> Hi!
>
> I want to do something like Apache Webserver's content negotiation using
> MultiViews with Cocoon.
>
> For example, I have documents like this:
>
> doc.de.xml
> doc.fr.xml
> doc.xml (default language)
>
> And want to do something like this:
>
> <map:act type="locale">
> <map:match pattern="doc">
> try {
> <map:generate src="doc.{../language}.xml"/>
> } catch (FileNotFoundException e) {
> <map:generate src="doc.xml"/>
> }
> <map:serialize/>
> </map:match>
> </map:act>
>
> Is something like this possible?
>
Does the ResourceExistsSelector meet your need?
http://cocoon.apache.org/2.1/userdocs/resourceexists-selector.html
<map:act type="locale">
<map:match pattern="doc">
<map:select type="resource-exists">
<map:when test="doc.{../language}.xml>
<map:generate src="doc.{../language}.xml"/>
</map:when>
<map:otherwise>
<map:generate src="doc.xml"/>
</map:otherwise>
</map:select>
<map:serialize/>
</map:match>
</map:act>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]