1
<ITEM>
     <PRODUCT_NAME>IT'S ALL ABOUT YOU-LG:9&quot;H RUBY GATHERNG VASE,RD ROSE,LIME GRN CARN,PURP STOCK,LAV POMS,ATHOS POM,SEAFOAM STATICE,SALAL</PRODUCT_NAME>
     <PRODUCT_CODE>90949L</PRODUCT_CODE>
     <PRODUCT_TYPE>FPT</PRODUCT_TYPE>
     <PRODUCT_CAT>Floral</PRODUCT_CAT>
     <ALIAS_NAME>IT'S ALL ABOUT YOU(TM) - LARGE</ALIAS_NAME>
     <DELIVERY_DATE>10/11/2012</DELIVERY_DATE>
     <FLEX_DATE></FLEX_DATE>
     <FLEX_TEXT></FLEX_TEXT>
     <QUANTITY>1</QUANTITY>
     <PRICE>69.99</PRICE>
     <CARD_MESSAGE>IT'S ALL ABOUT YOU...

当我不添加@XmlCDATA注释时,我只得到一个产品名称元素。但是当我使用 cdata 注释时,我得到了重复。一个带有 cdata 和没有 cdata

4

1 回答 1

0

By default a JAXB (JSR-222) implementation will expect annotations to be on the get (or set) methods. If you annotate a field this can cause a property to appear multiple times in the XML representation.

For More Information

于 2012-10-18T14:26:16.197 回答