[Yanel-dev] Re: [Wyona-commits] rev 30845 - public/yanel/trunk/src/impl/java/org/wyona/yanel/impl/resources

Michael Wechner michael.wechner at wyona.com
Mon Jan 28 23:56:50 CET 2008


Josias Thöny wrote:

> Michael Wechner wrote:
>
>> Sorry if might have checked in this wrong. But what is the logic 
>> behind this order? Could you add a comment explaing why it has to be 
>> this order? ;-)
>
>
> If no serializer is specified for a view, one is chosen according to 
> the mime-type. I slightly changed the order of mime-type checks such 
> that the mime-type "application/xhtml+xml" gets mapped to the 
> XHTML_STRICT serializer.
> I just added a note to the javadoc about this.


thanks very much

Michi

>
> josias
>
>>
>> Thanks
>>
>> Michi
>>
>> josias at wyona.com wrote:
>>
>>> Author: josias
>>> Date: 2008-01-28 10:54:54 +0100 (Mon, 28 Jan 2008)
>>> New Revision: 30845
>>>
>>> Modified:
>>>   
>>> public/yanel/trunk/src/impl/java/org/wyona/yanel/impl/resources/BasicXMLResource.java 
>>>
>>> Log:
>>> serializer: changed order of checks for xhtml-strict and xml. now 
>>> mime-type application/xhtml+xml uses the xhtml-strict serializer, as 
>>> it was before.
>>>
>>> Modified: 
>>> public/yanel/trunk/src/impl/java/org/wyona/yanel/impl/resources/BasicXMLResource.java 
>>>
>>> ===================================================================
>>> --- 
>>> public/yanel/trunk/src/impl/java/org/wyona/yanel/impl/resources/BasicXMLResource.java    
>>> 2008-01-28 09:48:57 UTC (rev 30844)
>>> +++ 
>>> public/yanel/trunk/src/impl/java/org/wyona/yanel/impl/resources/BasicXMLResource.java    
>>> 2008-01-28 09:54:54 UTC (rev 30845)
>>> @@ -236,7 +236,6 @@
>>>             if (xsltPaths == null || xsltPaths.length == 0) {
>>>                 xsltPaths = getXSLTPath(getPath());
>>>             }
>>> -                        SourceResolver uriResolver = new 
>>> SourceResolver(this);
>>>                         TransformerHandler[] xsltHandlers = new 
>>> TransformerHandler[xsltPaths.length];
>>> @@ -305,12 +304,12 @@
>>>
>>>             if (MimeTypeUtil.isHTML(mimeType) && 
>>> !MimeTypeUtil.isXML(mimeType)) {
>>>                 serializer = 
>>> SerializerFactory.getSerializer(SerializerFactory.HTML_TRANSITIONAL);
>>> +            } else if (MimeTypeUtil.isHTML(mimeType) && 
>>> MimeTypeUtil.isXML(mimeType)){
>>> +                serializer = 
>>> SerializerFactory.getSerializer(SerializerFactory.XHTML_STRICT);
>>>             } else if (MimeTypeUtil.isXML(mimeType)) {
>>>                 serializer = 
>>> SerializerFactory.getSerializer(SerializerFactory.XML);
>>>             } else if (MimeTypeUtil.isTextual(mimeType)) {
>>>                 serializer = 
>>> SerializerFactory.getSerializer(SerializerFactory.TEXT);
>>> -            } else if (MimeTypeUtil.isHTML(mimeType) && 
>>> MimeTypeUtil.isXML(mimeType)){
>>> -                serializer = 
>>> SerializerFactory.getSerializer(SerializerFactory.XHTML_STRICT);
>>>             } else{
>>>                 // For backwards compatibility leave XHTML as default
>>>                 serializer = 
>>> SerializerFactory.getSerializer(SerializerFactory.XHTML_STRICT);
>>>
>>> _______________________________________________
>>> Wyona-commits mailing list
>>> Wyona-commits at wyona.com
>>> http://lists.wyona.org/cgi-bin/mailman/listinfo/wyona-commits
>>>  
>>>
>>
>>
>
> _______________________________________________
> Yanel-development mailing list
> Yanel-development at wyona.com
> http://lists.wyona.org/cgi-bin/mailman/listinfo/yanel-development



-- 
Michael Wechner
Wyona      -   Open Source Content Management   -    Apache Lenya
http://www.wyona.com                      http://lenya.apache.org
michael.wechner at wyona.com                        michi at apache.org
+41 44 272 91 61



More information about the Yanel-development mailing list