You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Carsten Ziegeler <cz...@sundn.de> on 2000/11/02 16:55:41 UTC

C2: Bug in selector translation

I tried to use the Selectors again and found two problems
I used the following configuration:
	
	<map:selectors default="browser">
   		<map:selector src="org.apache.cocoon.selection.BrowserSelectorFactory" name="browser">
			<browser name="explorer" useragent="MSIE"/>
			<browser name="pocketexplorer" useragent="MSPIE"/>
			<browser name="handweb" useragent="HandHTTP"/>
			<browser name="avantgo" useragent="AvantGo"/>
			<browser name="imode" useragent="DoCoMo"/>
			<browser name="opera" useragent="Opera"/>
			<browser name="lynx" useragent="Lynx"/>
			<browser name="java" useragent="Java"/>
			<browser name="wap" useragent="Nokia"/>
			<browser name="wap" useragent="UP"/>
			<browser name="wap" useragent="Wapalizer"/>
			<browser name="mozilla5" useragent="Mozilla/5"/>
			<browser name="mozilla5" useragent="Netscape6/"/>
			<browser name="netscape" useragent="Mozilla"/>
  		</map:selector>
   		<map:selector src="de.sundn.prod.sunshine.selection.LocalSelectorFactory" name="sunShineLocalSelector"/>
	</map:selectors>

Both selectors are factories. The translation of the stylesheet invokes two times the method "generateClassSource()" of the default selector (here: "browser") but never of the second translator.

Using the following pipeline fragment (which doesn't make sense, I know - but it is works for the translation):
	<map:select type="sunShineLocalSelector">
		<map:when test="local">
			<map:redirect-to uri="licencing"/>
		</map:when>
		<map:otherwise>
			<map:redirect-to uri="portalsunshine"/>
		</map:otherwise>
	</map:select>
	<map:select type="browser">
		<map:when test="local">
			<map:redirect-to uri="licencing"/>
		</map:when>
		<map:otherwise>
			<map:redirect-to uri="portalsunshine"/>
		</map:otherwise>
	</map:select>
Only for the first map:when test="local" is code generated, but not for the second one.

I looked now for a very long time into the sitemap.xsl, but I don't see the bug. Does anyone of you?


Regards
Carsten Ziegeler

Open Source Group              sunShine - Lighting up e:Business
================================================================
Carsten Ziegeler, S&N AG, Klingenderstrasse 5, D-33100 Paderborn
www.sundn.de                           mailto:cziegeler@sundn.de 
================================================================


AW: C2: Bug in selector translation

Posted by Carsten Ziegeler <cz...@sundn.de>.
Giacomo Pati wrote:
> 
> This bug should be fixed now. Can you test it also?
> 
> Giacomo
> 
Yes, it works fine. Great.

Thank you,

Carsten



Open Source Group              sunShine - Lighting up e:Business
================================================================
Carsten Ziegeler, S&N AG, Klingenderstrasse 5, D-33100 Paderborn
www.sundn.de                           mailto:cziegeler@sundn.de 
================================================================


Re: C2: Bug in selector translation

Posted by Giacomo Pati <gi...@apache.org>.
This bug should be fixed now. Can you test it also?

Giacomo

Carsten Ziegeler wrote:
> 
> I tried to use the Selectors again and found two problems
> I used the following configuration:
> 
>         <map:selectors default="browser">
>                 <map:selector src="org.apache.cocoon.selection.BrowserSelectorFactory" name="browser">
>                         <browser name="explorer" useragent="MSIE"/>
>                         <browser name="pocketexplorer" useragent="MSPIE"/>
>                         <browser name="handweb" useragent="HandHTTP"/>
>                         <browser name="avantgo" useragent="AvantGo"/>
>                         <browser name="imode" useragent="DoCoMo"/>
>                         <browser name="opera" useragent="Opera"/>
>                         <browser name="lynx" useragent="Lynx"/>
>                         <browser name="java" useragent="Java"/>
>                         <browser name="wap" useragent="Nokia"/>
>                         <browser name="wap" useragent="UP"/>
>                         <browser name="wap" useragent="Wapalizer"/>
>                         <browser name="mozilla5" useragent="Mozilla/5"/>
>                         <browser name="mozilla5" useragent="Netscape6/"/>
>                         <browser name="netscape" useragent="Mozilla"/>
>                 </map:selector>
>                 <map:selector src="de.sundn.prod.sunshine.selection.LocalSelectorFactory" name="sunShineLocalSelector"/>
>         </map:selectors>
> 
> Both selectors are factories. The translation of the stylesheet invokes two times the method "generateClassSource()" of the default selector (here: "browser") but never of the second translator.
> 
> Using the following pipeline fragment (which doesn't make sense, I know - but it is works for the translation):
>         <map:select type="sunShineLocalSelector">
>                 <map:when test="local">
>                         <map:redirect-to uri="licencing"/>
>                 </map:when>
>                 <map:otherwise>
>                         <map:redirect-to uri="portalsunshine"/>
>                 </map:otherwise>
>         </map:select>
>         <map:select type="browser">
>                 <map:when test="local">
>                         <map:redirect-to uri="licencing"/>
>                 </map:when>
>                 <map:otherwise>
>                         <map:redirect-to uri="portalsunshine"/>
>                 </map:otherwise>
>         </map:select>
> Only for the first map:when test="local" is code generated, but not for the second one.
> 
> I looked now for a very long time into the sitemap.xsl, but I don't see the bug. Does anyone of you?
> 
> Regards
> Carsten Ziegeler
> 
> Open Source Group              sunShine - Lighting up e:Business
> ================================================================
> Carsten Ziegeler, S&N AG, Klingenderstrasse 5, D-33100 Paderborn
> www.sundn.de                           mailto:cziegeler@sundn.de
> ================================================================

Re: C2: Bug in selector translation

Posted by Giacomo Pati <gi...@apache.org>.
Carsten Ziegeler wrote:
> 
> I tried to use the Selectors again and found two problems
> I used the following configuration:
> 
>         <map:selectors default="browser">
>                 <map:selector src="org.apache.cocoon.selection.BrowserSelectorFactory" name="browser">
>                         <browser name="explorer" useragent="MSIE"/>
>                         <browser name="pocketexplorer" useragent="MSPIE"/>
>                         <browser name="handweb" useragent="HandHTTP"/>
>                         <browser name="avantgo" useragent="AvantGo"/>
>                         <browser name="imode" useragent="DoCoMo"/>
>                         <browser name="opera" useragent="Opera"/>
>                         <browser name="lynx" useragent="Lynx"/>
>                         <browser name="java" useragent="Java"/>
>                         <browser name="wap" useragent="Nokia"/>
>                         <browser name="wap" useragent="UP"/>
>                         <browser name="wap" useragent="Wapalizer"/>
>                         <browser name="mozilla5" useragent="Mozilla/5"/>
>                         <browser name="mozilla5" useragent="Netscape6/"/>
>                         <browser name="netscape" useragent="Mozilla"/>
>                 </map:selector>
>                 <map:selector src="de.sundn.prod.sunshine.selection.LocalSelectorFactory" name="sunShineLocalSelector"/>
>         </map:selectors>
> 
> Both selectors are factories. The translation of the stylesheet invokes two times the method "generateClassSource()" of the default selector (here: "browser") but never of the second translator.
> 
> Using the following pipeline fragment (which doesn't make sense, I know - but it is works for the translation):
>         <map:select type="sunShineLocalSelector">
>                 <map:when test="local">
>                         <map:redirect-to uri="licencing"/>
>                 </map:when>
>                 <map:otherwise>
>                         <map:redirect-to uri="portalsunshine"/>
>                 </map:otherwise>
>         </map:select>
>         <map:select type="browser">
>                 <map:when test="local">
>                         <map:redirect-to uri="licencing"/>
>                 </map:when>
>                 <map:otherwise>
>                         <map:redirect-to uri="portalsunshine"/>
>                 </map:otherwise>
>         </map:select>
> Only for the first map:when test="local" is code generated, but not for the second one.
> 
> I looked now for a very long time into the sitemap.xsl, but I don't see the bug. Does anyone of you?

I'll have a look at it at the weekend. 

Giacomo