[Yanel-dev] Broken meta and error pages

Andreas Wuest awuest at student.ethz.ch
Tue Feb 13 22:41:56 CET 2007


Hi

On 13.2.2007 20:52 Uhr, Andreas Wuest wrote:

> Hi
> 
> Yanel injects tags like <i18n:text> into the HTML title element, as can 
> be seen on for example http://www.yulup.org/faq.html?yanel.resource.meta.
> 
> The content model of the <title> element does only allow PCDATA, i.e. 
> elements are NOT allowed inside it. What are those i18n:text elements 
> for anyway??

Ok, I see that those are introduced via the 
src/webapp/xslt/xmlInfo2xhtml.xsl stylesheet.

IIUC, those tags should actually be translated using our 
I18nTransformer. Looking at I18nTransformer.java, it seems as it simply 
does not support <i18n:text/> elements. It only supports 
<i81n:message/>, which kind of makes me wonder, because the "i18n" 
prefix points to the Cocoon namespace, and Cocoon does NOT define a 
"message" element (at least as far as I can tell from their 
documentation). http://jakarta.apache.org/taglibs/i18n-1.0 does though.

The I18nTransfomer does not seem to be suited to work with Cocoon 
<i18n:text/> style elements anyway, because it uses a SAX parser and 
constructs the result document without lookahead. With other words: "The 
text between the <i18n:text>-tags is used as a key to find the 
translation in the dictionary." as defined in Cocoon is not possible to 
implement with the current design of our transformer.

As a preliminary solution, I've converted all <i18n:text/> elements in 
src/webapp/xslt/xmlInfo2xhtml.xsl to <i18n:message/>, and added a key. 
If the key is not found, our current transformer should at least perform 
an identity transformation, thereby replacing the elements with their 
text value. Funny thing is, our transformer never seems to get called...

Of course, this situation is quite broken, at least that's as how I 
understand it. I would therefore propose the following things:

1) Move all i18n elements to a Yanel namespace. Pretending it to be 
Cocoon when it is not, and we infact do not even support a single 
element or attribute as defined by Cocoon, helps nobody. At least be 
honest, and make sure that people know that we defined our own 
transformation language.

2) Rewrite the i18n transformer to actually support elements and 
attributes as defined by Cocoon (although we can still put them in our 
own namespace).

3) Rip out the i18n transformation altogether. The feature-set the 
current transformer offers can easily be achieved using XML entities, 
which would be automatically handled by the XML parser, no extra 
transformation necessary.

3) Simply use Cocoon's i18n transformer.

> One effect of this is that e.g. the above mentioned page shows up on a 
> Google search as "Yanel <i18n:text>- Page Info</i18n:text>". Pretty 
> ugly, if you ask me. And also embarrassing.
> 
> I've filed bug 
> http://bugzilla.wyona.com/cgi-bin/bugzilla/show_bug.cgi?id=5195. Please 
> change the component or title of the bug as you see fits, because I 
> don't know where those elements are actually coming from.

-- 
Kind regards,
Andi



More information about the Yanel-development mailing list