You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by wodzuuu <m....@kezzler.com> on 2010/06/21 11:22:17 UTC
Re: CDATA Example
Hello,
How about such example:
I want to output very simple XML:
...
<logEntry>
<code><![CDATA[ohohod]]></code>
<logEntry>
...
Now I am doing it this way:
...
XmlOptions opts = new XmlOptions();
opts.setUseCDataBookmarks();
final XmlLogEntry xmlEntry = XmlLogEntry.Factory.newInstance(opts);
xmlEntry.setCode("ohohod");
XmlCursor c = xmlEntry.xgetCode().newCursor();
c.toFirstContentToken();
c.setBookmark(CDataBookmark.CDATA_BOOKMARK);
c.dispose();
...
And of course it is not working - I am getting <code>ohohod</code>
One suprising thing is that code
c.getBookmark(CDataBookmark.CDATA_BOOKMARK); inserted just after
c.setBookmark(CDataBookmark.CDATA_BOOKMARK); returns null.
Do I need any additional configuration to make it work ?
Thanks in advance for any help.
--
View this message in context: http://old.nabble.com/CDATA-Example-tp17259867p28946544.html
Sent from the Xml Beans - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org