I think you are looking for, more specifically: SchemaType[] docTypes = schemaTypeSystem.documentTypes();
to get a list of all elements/document types in the SchemaTypeSystem you get from compileXsd() and then (assuming you are convinced there is only one); QName rootElName = docTypes[0].getDocumentElementName(); (But yeah, if you need to see how to generically create valid documents, look at how that tool is implemented) Radu > -----Original Message----- > From: Jacob Danner [mailto:[email protected]] > Sent: Tuesday, February 24, 2009 8:50 PM > To: [email protected]; [email protected] > Subject: Re: How to generically create a SchemaType instance doc? > > Take a peek at the xsd2inst tool under your xmlbeans_home\bin > directory -jacobd > > On Tue, Feb 24, 2009 at 5:41 PM, Andy Putnins > <[email protected]> wrote: > > Given a schem that has been parsed and loaded into a > > SchemaTypeSystema, how can I create a document instance > with just the root element? > > > > I don't have prior knowledge of the schema contents other > than knowing > > that it has a single global element. > > I can confirm that it has a global element with > > SchemaType.isDocumentType() > > but how should I proceed? Perhaps if I could discover it's QName, I > > could construct an element instance, but how? Or is there a better > > approach? > > > > - Andy > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [email protected] > > For additional commands, e-mail: [email protected] > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]

