CDATA problem, version 2.4

2008-09-12 Thread Bing Qiao
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
DataFieldlt;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]



RE: SchemaProperty returning null for maxOccurs = unbounded

2008-09-12 Thread Ole Matzura
Hi,

 

Sure thing.. thanks for clarifying!

 

Best Regards,

 

/Ole

Eviware.com

 

From: Radu Preotiuc-Pietro [mailto:[EMAIL PROTECTED] 
Sent: Saturday, September 13, 2008 00:14
To: user@xmlbeans.apache.org
Subject: RE: SchemaProperty returning null for maxOccurs = unbounded

 

The API of SchemaProperty.getMaxOccurs() states:  * Returns the
maxOccurs value for this particle, or null if it * is unbounded. It's a
design choice. If we returned MAX_INT then we wouldn't e able to handle the
case when maxOccurs is  MAX_INT, right? If you are not worried about that
case, just use SchemaProperty.getIntMaxOccurs() which will indeed return
MAX_INT for the unbounded case. Fair enough?

 

Radu

 


  _  


From: Ole Matzura [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 12, 2008 2:31 AM
To: user@xmlbeans.apache.org
Subject: SchemaProperty returning null for maxOccurs = unbounded

Hi!

 

I'm having an problem where a SchemaProperty retrieved with
getElementProperties() for an element with maxOccurs=unbounded returns
null from getMaxOccurs().. shouldn't it return MAX_INT or something? The
underlying SchemaTypeSystem was created dynamically from an xsd with
XmlBeans.compileXsd and not from an precompiled jar/xsb (if that should
matter..)

 

Thanks for any reply!

 

Regards,

 

/Ole

Eviware.com