cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From michael_ham...@sonynetservices.com
Subject XML-Forms and i18n
Date Fri, 26 Jul 2002 06:19:45 GMT

---------------------- Weitergeleitet von Michael Hampel on 26.07.2002
08:22 ---------------------------


michael_hampel@sonynetservices.com on 25.07.2002 20:07:14

Bitte antworten an cocoon-users@xml.apache.org

An:    cocoon-users@xml.apache.org
Kopie:
Thema: XML-Forms and i18n

Hello,

    I was just trying to change the XMLFormTransformer to add an
    <i18n:text> tag, when the Transformer is dealing with violations.
    I tried the following in the startElementViolations method:

      1.) I tried to add the tag like this:

      // render <violation> tag
            super.startElement(uri, TAG_VIOLATION, NS_PREFIX + ":" +
TAG_VIOLATION, attributes );
             // set message
       String startInter = "<i18n:text>";
        String endInter = "</i18n:text>";
            String vm = nextViolation.getMessage();
       String result = startInter + vm + endInter;
            super.characters( result.toCharArray(), 0, result.length());

            super.endElement(uri, TAG_VIOLATION, NS_PREFIX + ":" +
TAG_VIOLATION);

      2.) and like this:

      INTER_PREFIX = "i18n"
      TAG_VIOLATION="text"
      Here I thought that I could create the i18n tag like the
xf:validation tag is created

      // render <violation> tag
            super.startElement(uri, TAG_VIOLATION, NS_PREFIX + ":" +
TAG_VIOLATION, attributes );
        AttributesImpl emptyAttributes = new AttributesImpl();
        super.startElement(null, null, INTER_PREFIX + ":" + TAG_INTER,
emptyAttributes);
            String vm = nextViolation.getMessage();
            super.characters( vm.toCharArray(), 0, vm.length());
        super.endElement(null, null, INTER_PREFIX + ":" + TAG_INTER);
            super.endElement(uri, TAG_VIOLATION, NS_PREFIX + ":" +
TAG_VIOLATION);

Both ways did not work. In the first case I got an error message like this:
      <i18n:text>error_message</i18n:text>
but it was not translated - so I think that there were no real tags.
The second case was ignored completely  - according to the log.

Maybe somebody can advise if I do this at the right place, or if I should
try somewhere else
or how the Transformer works regarding the super.startElement() - if this
is the way how
to add a new element to the xml or if this is done differently?

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