title: Setting CharacterEscapeHandler variable on a Marshaller doesn't work as expected in CXF
body: <p>I'm using Apache CXF to implement some WebServices at server side. I have to implement a WebService that returns a string (Holder) with some values separated by tab character. Apache CXF encodes character tab as a tab, but our client (that can not be change...) doesn't accept it and only read tabs encoded as &amp;#9; . </p>
  
  <p>So I tried to simply make a replaceAll on the string to change \t for &amp;#9; , but an escapeHandler on Marshaller changes it to &amp;amp;#9; .</p>
  
  <p>Then I tried to create a customCharacterEscapeHandler and set in the marshall com.sun.xml.bind.marshaller.CharacterEscapeHandler property. </p>
  
  <pre><code>&lt;jaxws:endpoint 
    id="wsContainer" 
    implementor="com.xxxxx.xxxxx.xxxxx.webServices.impl.EOSWebServiceImpl"
    address="/ws" &gt;
  
    &lt;jaxws:dataBinding&gt;   
        &lt;bean class="org.apache.cxf.jaxb.JAXBDataBinding"&gt;
          &lt;property name="marshallerProperties"&gt;
              &lt;map&gt;
                  &lt;entry key="jaxb.encoding" value="UTF-8"/&gt; 
                  &lt;entry key="com.sun.xml.bind.marshaller.CharacterEscapeHandler" value-ref="customCharacterEscapeHandler"/&gt;
              &lt;/map&gt;        
          &lt;/property&gt;
        &lt;/bean&gt;
    &lt;/jaxws:dataBinding&gt;
  
  &lt;/jaxws:endpoint&gt;
  </code></pre>
  
  <p>And my customCharacterEscapeHandler is:</p>
  
  <pre><code>public class CustomCharacterEscapeHandler implements CharacterEscapeHandler {
  
      private final CharsetEncoder encoder;
  
      public CustomCharacterEscapeHandler(String charsetName) {
          this.encoder = Charset.forName(charsetName).newEncoder(); 
      }
  
      public void escape(char[] ch, int start, int length, boolean isAttVal, Writer out) throws IOException {
          int limit = start+length;
          for (int i = start; i &lt; limit; i++) {
              switch (ch[i]) {
              case SoapUtils.SOAP_FIELD_SEP: //Cambios sobre el NioEscapeHandler para escapar tabuladores y saltos de linea
                  out.write("&amp;#09;");
                  break;
              case SoapUtils.SOAP_RSEP:
                  out.write("&amp;#13;");
                  break;
              case '&amp;':
                  out.write("&amp;amp;");
                  break;
              case '&lt;':
                  out.write("&amp;lt;");
                  break;
              case '&gt;':
                  out.write("&amp;gt;");
                  break;
              case '\"':
                  if (isAttVal) {
                      out.write("&amp;quot;");
                  } else {
                      out.write('\"');
                  }
                  break;
              default:
                  if( encoder.canEncode(ch[i]) ) {
                      out.write(ch[i]);
                  } else {
                      out.write("&amp;#");
                      out.write(Integer.toString(ch[i]));
                      out.write(';');
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p>This should work but it doesn't, because this escapeHandler replace correctly the tab character, but some other escapeHandler is running after this and replaces again '&amp;' character, so I have &amp;amp;#9; again ... </p>
  
  <p>What should I do to get in the client a tab encoded as &amp;#9; ??</p>
  
  <p>PS: I'm using Apache CXF 2.5.X</p>