You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Jacob Danner <ja...@gmail.com> on 2009/06/16 10:02:03 UTC

Re: How creating an XmlObject only knowing the name of the generated document class?

Have you tried
 XmlObject xmlobject = XmlObject.Factory.newInstance()?

-jacobd

On Tue, Jun 16, 2009 at 12:01 AM, Hildegunde
Weinzierl<Hi...@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-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


RE: Antwort: Re: How creating an XmlObject only knowing the name of the generated document class?

Posted by Radu Preotiuc-Pietro <ra...@oracle.com>.
Just making sure you have seen Kapil Anand's post earlier today (Wed). I think that's what you are looking for also.
 
Radu


  _____  

From: Hildegunde Weinzierl [mailto:Hildegunde.Weinzierl@esg.de] 
Sent: Tuesday, June 16, 2009 4:07 AM
To: user@xmlbeans.apache.org
Subject: Antwort: Re: How creating an XmlObject only knowing the name of the generated document class?



Hi, 

yes, but I need the SchemaType of the corresponding MyReportDocument. 

Best regards

Hildegunde Weinzierl

Antwort: Re: How creating an XmlObject only knowing the name of the generated document class?

Posted by Hildegunde Weinzierl <Hi...@esg.de>.
Hi,

yes, but I need the SchemaType of the corresponding MyReportDocument.

Best regards

Hildegunde Weinzierl