logo       

Is there a way to instantiate a root element and have all sub-elements also: msg#00011

text.xml.xmlbeans.user

Subject: Is there a way to instantiate a root element and have all sub-elements also created?

When I do a Root.Factory.newInstance(), the Root object is created, but all the sub-elements of Root are not.  So when I try root.getSubelementA().whatever(), I get a null error because subelementA is not instantiated. Is there a way to call a new instance but have it create deeply all the sub-elements of Root so that this doesn't occur?  Likewise, when I call root.addSubelement(), the new Subelement does not instantiate its constituent parts. 

So I guess my question is, is there an easy way to instantiate all the constituent parts of an object instead of just the bare object itself?  Thanks.

B.
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise