[Yanel-dev] Another namespace problem with the XML resource
Josias Thöny
josias.thoeny at wyona.com
Wed Aug 15 10:28:17 CEST 2007
Michael Wechner wrote:
> Hi
>
> Is it possible that if no XSLT is being applied when using the XML
> resource, that all namespaces are being stripped off, e.g.
>
> the original
>
> <service xmlns="http://www.w3.org/2007/app"
> xmlns:atom="http://www.w3.org/2005/Atom">
> <workspace title="Yulup Website">
> <atom:title type="text">Yulup Website</atom:title>
> <collection title="Releases"
> href="release-atom-entries/?yanel.resource.viewid=atom">
> <atom:title type="text">Releases</atom:title>
> </collection>
> <collection title="News"
> href="../news-entries/?yanel.resource.viewid=atom">
> <atom:title type="text">News</atom:title>
> </collection>
> </workspace>
> </service>
>
> is being delivered as
>
> <service>
> <workspace title="Yulup Website">
> <atom:title type="text">Yulup Website</atom:title>
> <collection title="Releases"
> href="release-atom-entries/?yanel.resource.viewid=atom">
> <atom:title type="text">Releases</atom:title>
> </collection>
> <collection title="News"
> href="../news-entries/?yanel.resource.viewid=atom">
> <atom:title type="text">News</atom:title>
> </collection>
> </workspace>
> </service>
>
>
> Any idea what might be wrong?
I'm able to reproduce the problem, and I found this workaround:
add this line to BasicXMLResource.java at line 119:
xmlReader.setFeature("http://xml.org/sax/features/namespace-prefixes",
true);
However I'm not sure if this is a good solution. I guess the "correct"
solution would be to implement namespace normalization in the
XMLSerializer. But that might be a lot of work...
Josias
>
> Thanks
>
> Michi
>
More information about the Yanel-development
mailing list