You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Kent Spaulding <Ke...@Sun.COM> on 2005/07/26 20:47:58 UTC
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
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org