Hi All,
Will you please respond to my question?
My question restated, goal is not know "elementFormDefault" value of the
schema where the global element/type is defined.
How do I do this with xmlbeans API?
Regards
Murali
Murali Pottlapelli wrote:
Hi All,
I load schema document using snippet below
File schFile = new File("c:\\tmp\\schema.xsd");
SchemaDocument schemaDoc = SchemaDocument.Factory.parse(schFile);
XmlOptions options = new XmlOptions();
options.setCompileDownloadUrls();
SchemaTypeSystem ts = XmlBeans.compileXsd(new SchemaDocument[]
{ schemaDoc }, XmlBeans.getContextTypeLoader(), options);
SchemaTypeLoader loader = XmlBeans.typeLoaderUnion(new
SchemaTypeLoader[] { XmlBeans.getContextTypeLoader(), ts });
Query given element's definition by
SchemaGlobalElement typeADef = loader.findElement(new
QName("http://xml.netbeans.org/schema/Synchronous", "typeA"));
How do I find schema attribute "elementFormDefault" value for this
element?
By exploring API, it is possible by,
schemaDoc.getSchema().getElementFormDefault(). Is it possible to
navigate from SchemaGlobalElement object to its Schema? I could not
find an API for this.
Is there another way to do this?
My goal is to query a given element's schema attribute
"elementFormDefault"?
Thanks for your help!
Regards
Murali