Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle TopLink
11g Release 1 (11.1.1)


Annotation Type XmlCDATA

public @interface XmlCDATA

Wrap the value inside a CDATA section. Normally JAXB will escape certain characters in a string during a marshal operation:

This means a property foo with string value "1 < 2" without @XmlCDATA will be marshalled as <foo>1 &lt; 2</foo>. When @XmlCDATA is used the content is marshalled as <foo><![CDATA[1 < 2]]></foo>.Example

 import javax.xml.bind.annotation.XmlRootElement; 
 import org.eclipse.persistence.oxm.annotations.XmlCDATA;
 public class Root {
     private String foo;

     public String getFoo() {
         return foo;

     public void setFoo(String foo) { = foo;

Skip navigation links

Copyright © 1998, 2012, Oracle. All Rights Reserved.