You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Don Stewart <Do...@corizon.com> on 2004/09/23 18:02:10 UTC

Mixed Content Elements

Hi,

 

The question that has me stumped is how to use mixed content elements. I
have seen the BEA document and am puzzled as it uses the XmlCursor.

Is there no method created on the beans to set the tag body e.g.
setBody("foo")?

 

I have a schema with many defined types and only 2 of them are mixed
content. I cannot see how to create the fields with the XmlCursor and
then add them to a parent element.

e.g.

 

FieldWrapperDocument.FieldWrapper = foo.addNewFieldWrapper();

.....

FieldDocument.Field xmlCursor = FieldDocument.Factory.newInstance();

XmlCursor lXmlCursor = lFieldDocument.newCursor();

lXmlCursor.toFirstContentToken();

lXmlCursor.beginElement("field");

lXmlCursor.insertAttributeWithValue("name", "field1");

lXmlCursor.insertAttributeWithValue("label", "Field 1");

lXmlCursor.insertChars(functionVal);            

lXmlCursor.dispose();

 

How do I add the Field or FieldDocument created with the cursor to the
FieldWrapper created previously?

 

Many Thanks

 

Don