Have you tried XmlObject xmlobject = XmlObject.Factory.newInstance()? -jacobd
On Tue, Jun 16, 2009 at 12:01 AM, Hildegunde Weinzierl<hildegunde.weinzi...@esg.de> wrote: > > Hi, > > how can I get the XmlObject like I would get with the following call > > XmlObject xmlobject = OwnReportDocument.Factory.newInstance(); > > but without using the generated Document-Class 'OwnReportDocument'. > > I tried using the following code and got a NoSuchMethodException (no > <init>-function!): > > String messagetype = "mynamespace.OwnReportDocument"; // also tested > ...$Factory > Class<?> clas = Class.forName(messagetype); > Constructor ctor = clas.getConstructor(); > ctor.setAccessible(true); > XmlObject xmlobject = (XmlObject)ctor.newInstance(); > // also tested clas.newInstance()! > > Is there another way to create a new XmlObject only knowing the name of the > generated Document class? > > > Best regards > > Hildegunde Weinzierl > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org