cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Colin Paul Adams <co...@colina.demon.co.uk>
Subject Re: Request headers
Date Mon, 26 Jul 2004 11:23:34 GMT
>>>>> "Colin" == Colin Paul Adams <colin@colina.demon.co.uk> writes:

    Colin> I think I'll write a RegexpHeaderSelector.

I've done this, and it works to the limit of my testing - namely one
example:

     <map:selector name="content-type" src="org.apache.cocoon.selection.RegexpHeaderSelector">
	<pattern name="xhtml">^.*application/xhtml\+xml.*$</pattern>
	<header-name>accept</header-name>
      </map:selector>

     <map:match pattern="test">
	<map:select type="content-type">
	  <map:when test="xhtml">
	    <map:read src="test.xhtml" mime-type="application/xhtml+xml"/>
	  </map:when>
	  <map:otherwise>
	    <map:read src="test.html" mime-type="text/html"/>
	  </map:otherwise>
	</map:select>
      </map:match>

Mozilla and Opera display test.xhtml whereas Lynx and Konqueror
display test.html. I don't have MSIE, but I've asked a friend to test
it, and I have no doubt it will display test.html.

This I think is useful. How can I contribute it to Cocoon (I've only
written the java class - I don't know where I should add documentation).
-- 
Colin Paul Adams
Preston Lancashire

Mime
View raw message