Hi, can anyone help me
with the following problem on "SchemaTypeSystem"?

I have to load Xml-Instances without knowing the corresponding Schema-Definition.

That means
a) I cannot precompile Schemas to Java-Models.
b) I load my Xml-Files using XmlObject.Factory.parse(aFile).

On the other hand most of my input files reference to a
dedicated schema-definition (via xsi:schemaLocation)
and I would like to make XmlBeans providing me XmlObjects
with an "integrated" schema type system that represent
the referenced (xsi:schemaLocation) schema-definition.

Under http://xmlbeans.apache.org/docs/2.0.0/guide/conIntroToTheSchemaTypeSystem.html
I found the following statement:

   /When you compile schema, the API generated from your schema is
   integrated with the XMLBeans type system that represents the
   underlying XML schema. All together, these types make up the /schema
   type system/ to which your code has access. [...] when you want to
   get information about the schema itself, you use the schema type
   system API.
   /

As I want to get information about the referenced schema at runtime
I'm wondering if anything comparable would be possible without apriori compiling schemas.

I've tried the folling code without succes:

protected XmlObject buildDoc(File input) throws XmlException, IOException {
               XmlOptions xopt=new XmlOptions();
               xopt.setCompileDownloadUrls();  xopt.setValidateOnSet();
xopt.setLoadUseDefaultResolver(); xopt.setLoadUseDefaultResolver();
               final XmlObject xo = XmlObject.Factory.parse(input,xopt);
               System.err.println(xo.type);
               return xo;
           }

As system output I would have expected something like
       /[EMAIL PROTECTED]/gwml/
but unfortunatally I always get
       /[EMAIL PROTECTED]://www.w3.org/2001/XMLSchema/

Maybe that's a stupid approch, as "xo.type" refers to the static member "type" of the build-in Class "XmlObject". Anyway I keep on hoping, that there may be
some better approch fitting my needs.

Thanks in advance

Siggi

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to