cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Konstantin Piroumian" <kpiroum...@apache.org>
Subject Re: i18n trouble with nested elements in catalog messages
Date Tue, 09 Sep 2003 07:00:34 GMT
Not sure if this is an i18n transformer issue, but it is worth to take a
look at the MirrorRecorder class (in transformation/helpers). Probably, it
simply doesn't record the uri and the local name when parsing a translation.
It should be quite easy to add support for it.

I'll take a look at it if I have time.

-- Konstantin

From: "Olivier Lange" <olange@petit-atelier.ch>

> Hello all,
>
> Does anybody know if the i18n transformer supports nested elements within
> the catalog messages? I examined the tranformer's source code (Cocoon
2.1),
> but it is not obvious to me.
>
> If not, would it be possible and make sense to enable support for nested
> elements with attributes and namespaces? Or would it not be desirable?
>
> I would like to have short structured text messages (XML fragments) within
> the catalog, rather that just plain text messages (character strings).
>
> Let me give an example. I'd like to translate the following <i18n:text>
> element:
>
> index.xml
>
>   ...
>     <i18n:text>21</i18n:text>
>   ...
>
> with the following message:
>
> messages_en.xml:
>
>   <catalogue xml:lang="en"
>     xmlns:d="urn:petit-atelier.ch:docmini:v1.1"
>     xmlns:xlink="http://www.w3.org/1999/xlink">
>
>     <message key="21">
>       <d:p> ...<d:email href="user@domain.ch"/>... </d:p>
>       <d:p>...</d:p>
>     </message>
>   </catalogue>
>
> I tried with the following sitemap:
>
> sitemap.xmap:
>
>     <map:match pattern="*/events/index.html"
>       <map:generate src="cocoon:/events/index.xml">
>       <map:transform type="i18n">
>           <map:parameter name="locale" value="{1}"/>
>       </map:transform>
>       <map:serialize type="xhtml"/>
>     </map:match>
>
> and almost succeeded. When I serialized immediately after the i18n
> transformation, it worked well, seemingly at least*: the output contained
> the <d:p> ...<d:email href="user@domain.ch"/>... </d:p> <d:p>...</d:p>
> structured text.
>
> But when I added some XSLT transformation or any other transformation, I
ran
> into trouble. The following generates a NPE (Cocoon 2.1/Tomcat 4.1.27/JDK
> 1.4.1_02/win2k):
>
> sitemap.xmap:
>
>       ...
>       <map:transform type="i18n">
>           <map:parameter name="locale" value="{1}"/>
>       </map:transform>
>       <map:transform type="xslt" src="docmini-to-xhtml.xsl"/>
>       <map:serialize type="xhtml"/>
>     </map:match>
>
> (The docmini-to-xhtml transformation runs fine on the Xalan command-line
> with the serialised output of the previous pipeline).
>
> This happens with any transformer (xsl, linkrewriter, log, ...).
>
> Is this happening because the i18n transformer is not intended to support
> nested elements?
>
> * A closer inspection with the Log transformer gave me the feeling that
the
> SAX flow was compromised
>
(uri=*null*,local=*null*,qname=href,type=CDATA,value=mailto:user@domain.ch)
>
> Olivier
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message