Hello,

I just started using XmlBeans and have been troubled with the use of
CDATA since the beginning.

I'm using version 2.4. The problem is, some elements are read or saved
automatically as CDATA while others simply won't come out as CDATA no
matter what I do.
I read a few previous posts here and tried what mentioned in them but
it didn't work.

The document is created by:

XmlOptions opts = new XmlOptions();
opts.setUseCDataBookmarks();
reportDocument = ReportDocument.Factory.newInstance(opts);

Then the field is created by:
FieldsType fields = FieldsType.Factory.newInstance();
FieldType field = fields.addNewField();
field.setName(column.getClsName());
field.addDataField("<br>");
XmlCursor c = field.xgetDataFieldArray(0).newCursor();
c.toFirstContentToken();
c.setBookmark(CDataBookmark.CDATA_BOOKMARK);

reportDocument.toString() returns the xml:
...
<Fields>
<Field Name="Account_Currency">
    <DataField>&lt;br></DataField>
</Field>
</Fields>
...

I need the DataField content to be CDATA. As shown above, I tried
using CDATA_BOOKMARK, but it just doesn't work.

Any help please thanks very much!

Bing

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to