[Yanel-dev] XML Resource serializer problem

Michael Wechner michael.wechner at wyona.com
Tue Jan 1 23:34:53 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 &lt;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?


it seems to me that

src/impl/java/org/wyona/yanel/impl/resources/BasicXMLResource.java

should retuen the view if no XSLT has been set

String[] xsltPaths = viewDescriptor.getXSLTPaths();
            if (xsltPaths == null || xsltPaths.length == 0) {
                xsltPaths = getXSLTPath(getPath());
            }

whereas I have noticed that even if no XSLT is being configured 
xsltPaths won't be null, because

    protected String[] getXSLTPath(String path) throws Exception {
        String[] xsltPath = getResourceConfigProperties("xslt");
        if (xsltPath != null) return xsltPath;
        log.info("No XSLT Path within: " + path);
        return new String[0];

but I'm not sure if this really makes sense (only maybe because if one 
still wants to apply the i18n Transformer, but that has actually nothing 
to do with the XSLTs.

WDYT?

Thanks

Michi

>
> Thanks
>
> Michi
>


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



More information about the Yanel-development mailing list