16 messages in org.apache.xmlbeans.userRE: Creating complexType objects...
FromSent OnAttachments
Kent SpauldingJul 26, 2005 11:47 am 
Don StewartJul 27, 2005 1:58 am 
Caroline WoodJul 27, 2005 2:01 am 
Kent SpauldingJul 27, 2005 8:05 am 
Cezar AndreiJul 27, 2005 9:55 am 
Dave HarrisonJul 27, 2005 10:09 am 
stephJul 27, 2005 10:41 am 
Dave HarrisonJul 27, 2005 11:09 am 
Kent SpauldingJul 27, 2005 11:28 am 
Stephane MorucciJul 27, 2005 11:29 am 
Kent SpauldingJul 27, 2005 11:44 am 
Cezar AndreiJul 27, 2005 2:10 pm 
Dave HarrisonJul 27, 2005 2:44 pm 
Kent SpauldingJul 27, 2005 3:31 pm 
Dave HarrisonJul 28, 2005 5:43 am 
Kent SpauldingJul 28, 2005 9:56 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:RE: Creating complexType objects...Actions...
From:Don Stewart (Don.@corizon.com)
Date:Jul 27, 2005 1:58:30 am
List:org.apache.xmlbeans.user

Kent,

In the first example replace print(foo); with print(foo.xmlText());

Regards

Don

-----Original Message----- From: Kent@Sun.COM [mailto:Kent@Sun.COM] Sent: 26 July 2005 19:48 To: us@xmlbeans.apache.org Subject: Creating complexType objects...

I've looked over all the doc, and archives, and haven't found if there's an easier to do what I'd like in XmlBeans 2.0.0.

It looks like to create an XmlObject that has a name other than "xml-fragment" in the first element, you need to go through an object type that contains that type.

i.e. If I have Foo defined as a type with just a name attribute:

Foo foo = Foo.Factory.newInstance(); foo.setName("name"); print(foo);

gives:

<xml-fragment name="name"/>

If I want <foo name="name"/> as the xml - I need to find a type (let's call it Bar) that encloses the Foo type and do:

Bar bar = Bar.Factory.newInstance(); Foo foo = bar.addNewFoo(); foo.setName("name"); foo.set(bar);

now foo is:

<foo name="name"/>

Is this really what's required?

If this made no sense; I can send a more concrete example.

Thanks for the help, --Kent