[Yanel-dev] serialization & RC problems

Guillaume Déflache guillaume.deflache at wyona.com
Tue Jun 1 13:48:55 CEST 2010


Hi!

I am trying to serialize a page in XHTML Strict in Yanel using only RC 
configuration like in:
>         <serializer key="XHTML_STRICT">
>           <omit-xml-declaration>yes</omit-xml-declaration>
>           <method>html</method>
>           <encoding>UTF-8</encoding>
> <!--
>           <indent>no</indent>
> -->
>         </serializer>

The exact doctype I need is:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

So far I only had been able to get:
<!DOCTYPE xml PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

This confuses Firefox and the page display gets all messed up.


Yanel's custom serializer implementation wrongly uses the 'method' 
serializer output property as the root element name in the doctype 
declaration. cf. 
http://svn.wyona.com/repos/public/yanel/trunk/src/core/java/org/wyona/yanel/core/serialization/XMLSerializer.java 
and look for'"method"' there.

Because of that, I tried to set the 'method' serializer output property 
by hand using the RC file (see above): it didn't work because it is not 
read in ConfigurableViewDescriptor#configure (cf. 
<http://svn.wyona.com/repos/public/yanel/trunk/src/impl/java/org/wyona/yanel/impl/resources/xml/ConfigurableViewDescriptor.java>), 
and probably rightly so because the serializer key implies which method 
should be used.

So ATM there is no way to set the XHTML doctype correctly using only RC 
configuration. (Note: it can be done by doing some method overloading in 
Java though, but that's a lot more work).
I think the doctype declaration should really only be written when the 
root element is known so that it is always correct regardless of the 
required output method.
WDYT?


Also previously I tried to set public and system doctype identifiers 
manually in the RC, and it did not work for the system one: I now know 
why: there is a typo in 
<http://svn.wyona.com/repos/public/yanel/trunk/src/impl/java/org/wyona/yanel/impl/resources/xml/ConfigurableViewDescriptor.java>, 
look for "doctype-sytem" there!


HTH,
    Guillaume


More information about the Yanel-development mailing list