I'm using Java JAXB annotations to process and unmarshall XML document. If content of document is CDATA, it is propertly deserialized to String.
So if element is:
<elem><![CDATA[ something ]]></elem>
result of this operation
@XmlValue
protected String value;
is string:
\t\n\rsomething\t\n\r
which is OK.
Now my problem - how to tell if this element had CDATA annotation, or no - how to differentiate between
<elem><![CDATA[ something ]]></elem>
<elem>something</elem>
elements? I tried custom XmlTypeAdapters but no luck (string is already processed when reaches this point).
Thanks.