cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Piroumian Konstantin <KPiroum...@protek.com>
Subject RE: Antwort: Re: Antwort: RE: XML Forms and i18n
Date Fri, 26 Jul 2002 14:19:56 GMT
> From: michael_hampel@sonynetservices.com 
> 
> Hello,
> 
>    Yes, I tried this, but I don´t think that the i18n tags 
> are copied with
> the error message, as
>    the translation is not working.
>    I have the internationalisation running with the XML-form example.
>    There it is quite easy , as you only have to alter the 
> wizard2html.xml.
>    In there you are doing something like
>       if<xf:violation>
>                       value-of select ="."
> 
>    I only wrap this with
>       <i18n:text>value-of select="."</i18n:text>

I think that more correct would be to change it like this:
If <xf:violation>
  <xsl:apply-templates select="." />

And have a template that will just copy everything that is not matched,
e.g.:
<xsl:template match="node()" priority="-1">
	<xsl:copy />
</xsl:template>

(or 'xsl:copy-of' - one of this doesn't deal with namespaces correctly, try
both).
This will allow you to add i18n and other tags as you like.

Something similar should be done also for the FormTransformer - it should
just copy all the content that it does not handle.

Konstantin

> 
>    and run the i18n Transformer. This works fine.
>    The problem is, that in the xml I have I would have to write a new
> stylesheet for
>    every xml file again to find the xf:violation tags as each xml file
> differs a lot
>    from another.
>    To avoid this I tried to find an other solution.
>    I of course agree that adding the i18n tag  in the 
> FormTransormer is not
> the
>    best solution, but in my case it would not matter, because 
> every error
> message
>    has to get translated.
>    What I am trying now is to translate the error message in my
> RegistrationAction, where
>    I also do my customized validation.
>    For this I am trying to use the functionality of the 
> i18nTransormer and
> the ResourceBundleFactory
>    to find and to translate the messages.
>    This of course will mean, that I can´t use Schematron 
> validation anymore
> and also it is not
>    running yet:)
>    So, maybe you have a hint how I could wrap the message in the
> FormTransformer, if this would
>    then be easier.
> 
> 
>    Thanx again for any help,
> 
>    miHam
> 
> 
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
> 
> To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
> For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>
> 

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

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


Mime
View raw message