[Yanel-dev] XML Resource serializer problem
Josias Thöny
josias.thoeny at wyona.com
Mon Jan 7 09:28:08 CET 2008
Michael Wechner wrote:
> Hi
>
> It seems to me that the XML resource has still some troubles re
> serializer in some cases. For instance when I try to serve some APP
> service document with mime type application/atomsvc+xml and it contains
> some XHTML snippets, then the APP namespace is being replaced by the
> XHTML namespace
>
> http://127.0.0.1:8080/yanel/yulup-demo/atom/entries/introspection-.xml
>
> resp.
>
> http://demo.yulup.org/atom/entries/introspection-.xml
>
>
> <?x
> ml version="1.0"?>.<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
> Strict//EN" "http://www.w3.org/T
> R/xhtml1/DTD/xhtml1-strict.dtd">.<service
> xmlns="http://www.w3.org/1999/xhtml">. <workspace tit
> le="Yulup Demo">. <title type="text">Yulup Demo</title>..
> <collection title="Releases" hre
> f="../entries/?yanel.resource.viewid=atom">. <title
> type="html">Early Yulup <i>Releases&
> lt;/i></title>.. </collection>... </workspace>.. <workspace
> title="Yulup Website">. <tit
> le type="text">Yulup Website</title>.. <collection title="Releases"
> href="http://www.yulup.or
> g/download/release-atom-entries/?yanel.resource.viewid=atom">.
> <title type="xhtml"><div>Yul
> up <b>Releases</b></div>.</title>.. </collection>...
> </workspace>..</service>
>
>
> whereas this doesn't happen when setting the mime type to
> application/xml within the resource config of this particular document.
> Also please note it doesn't happen for
>
> http://www.yulup.org/download/introspection-atom.xml
>
> or
>
> http://www.yulup.org/news-entries/introspection-atom.xml
>
> Any idea what might be wrong?
I guess this happens because it's using the XHTML serializer.
If no serializer is configured in the rc, the following "fallback" is
implemented:
if mimetype == "text/html" -> use HTML serializer
if mimetype == "application/xml" -> use XML serializer
else use XHTML_STRICT serializer
Do you think this behaviour should be changed?
To solve your problem you could try to specify the serializer
explicitely in the rc:
<yanel:custom-config>
<views>
<view id="default">
<mime-type>application/atomsvc+xml</mime-type>
<serializer key="XML"/>
</view>
</views>
</yanel:custom-config>
josias
>
> Thanks
>
> Michi
>
More information about the Yanel-development
mailing list