[Yanel-dev] BasicXMLResource inconsistencies

Josias Thöny josias.thoeny at wyona.com
Mon Jan 14 16:43:18 CET 2008


Evaldas Taroza wrote:
> 
> 
> Josias Thöny wrote:
>> Evaldas Taroza wrote:
>>> Josias Thöny wrote:
>>>> Evaldas Taroza wrote:
>>>>> Hi,
>>>>> there are static properties in BasicXMLResource:
>>>>> SERIALIZER_OMIT_XML_DECLARATION = "serializer-omit-xml-declaration";
>>>>> SERIALIZER_DOCTYPE_PUBLIC = "serializer-doctype-public";
>>>>> SERIALIZER_DOCTYPE_SYSTEM = "serializer-doctype-system";
>>>>
>>>> I think those properties are obsolete and should be removed.
>>>> Thanks for pointing this out.
>>>>
>>>> The serializer can be overridden in the rc like so:
>>>>
>>>> <yanel:custom-config>
>>>>   <views>
>>>>     <view id="default">
>>>>       <mime-type>text/html</mime-type>
>>>>       <xslt>/xslt/global.xsl</xslt>
>>>>       <serializer key="HTML_TRANSITIONAL">
>>>>         <omit-xml-declaration>yes</omit-xml-declaration>
>>>>         <doctype-public>-//W3C//DTD XHTML 1.0 
>>>> Transitional//EN</doctype-public>
>>>>
>>>> <doctype-system>http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</doctype-system> 
>>>>
>>>>       </serializer>
>>>>     </view>
>>>>   </views>
>>>> </yanel:custom-config>
>>>>
>>> The thing is that these properties
>>> <omit-xml-declaration>
>>> <doctype-public>
>>> <doctype-system>
>>>
>>> don't override serializer's behaviour... That needs to be implemented 
>>> in BasicXMLResource.
>>
>> Hm, it's implemented as follows (line 276):
>>
>> // allow to override xml declaration and doctype:
>>         Properties properties = viewDescriptor.getSerializerProperties();
>>         if (properties != null) {
>>             Enumeration propNames = properties.propertyNames();
>>             while (propNames.hasMoreElements()) {
>>                 String name = (String)propNames.nextElement();
>>                 String value = properties.getProperty(name);
>>
>>                 serializer.getOutputFormat().setProperty(name, value);
>>             }
>>         }
>>
>> do you think it's not working?
> 
> Yeah, it is really implemented. Still with this view:
> <view id="default">
>         <mime-type>text/html</mime-type>
>         <xslt>/xslt/brand-browser-xml2json.xsl</xslt>
>         <serializer key="HTML_TRANSITIONAL">
>           <omit-xml-declaration>yes</omit-xml-declaration>
>           <doctype-public>-//W3C//DTD XHTML 1.0 
> Transitional//EN</doctype-public>
> 
> <doctype-system>http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</doctype-system> 
> 
>         </serializer>
>       </view>
> 
> The generated XHTML has the following header:
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//DE" 
> "http://www.w3.org/TR/html4/loose.dtd">
> 
> which is not quite as specified.

This looks like a bug.
I'm quite busy right now, but I'll try to debug this later, unless 
somebody beats me to do it.

josias

> 
> Evaldas
> _______________________________________________
> Yanel-development mailing list
> Yanel-development at wyona.com
> http://lists.wyona.org/cgi-bin/mailman/listinfo/yanel-development



More information about the Yanel-development mailing list