cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ramy Mamdouh" <r...@imkenberg.de>
Subject Stuck in i18n and JDom
Date Wed, 18 Oct 2000 20:07:49 GMT
Hi All

I'm trying to add i18n to elements added dynamically from a Dom Transformer.
I'm using JDom to surround the elements with <i18n:text>
here is the code I'm using

org.jdom.Element CaptionEl = new org.jdom.Element(MenuParser.CAPTION);
org.jdom.Element I18nEl = new org.jdom.Element("text", "i18n", "http://apache.org/cocoon/i18n/2.0");
I18nEl.setText(item.getCaption());
CaptionEl.addContent(I18nEl);

when I use the I18nTransformer after the above transformer, I got a NullPointerException,
Although when I used a LogTransformer to check the output XML, it was perfectly right..

Here's a sample output from the Log File used after the above code

[startElement] uri=,local=caption,raw=caption
[startElement] uri=http://apache.org/cocoon/i18n/2.0,local=text,raw=i18n:text
[characters] About
[endElement] uri=http://apache.org/cocoon/i18n/2.0,local=text,qname=i18n:text
[endElement] uri=,local=caption,qname=caption

So, the About should be used as a key and should be translated when the i18n transformer used
by locating
the correct catalogue...

when I remove the I18nTransformer from the sitemap, I get no errors
and when I use just the I18nTransformer for static text alone, it gets translated correctly
and the <i18n:text> parts in the log file are exactly the same for both elements coming
from the static file
or from the above code.

and the error page is attached to this message...

Thanks in advance

Yours
Ramy

Mime
View raw message