Sorry for the confusion.  My application does not deal with the Java
implementation of any of the schema types.  It uses the information from the
schema to determine test cases to generate and then uses the XMLBeans API
(mainly XmlCursor) to create an XML instance.  Once the instance is complete
I then validate it via the XmlObject.validate(XmlOptions options) method and
save the object to a file.

One of the first things I do is to compile the schema XSD (with
XmlBeans.compileXsd(...)) to get a SchemaTypeSystem object. This provides me
with everything else I need.

The schema defines several abstract types, each of which has some number of
other schema types that extend them (i.e. <xs:extension
base="myPrefix:AbstractBaseType">).  As the program works its way through a
document type to identify and generate test cases, when it encounters an
element defined by an abstract type, it scans the schema for any types that
extend that type.  It then generates the element with the type reference
attribute to point to the specific concrete schema type.  I also generate
the child content that is defined by the specific concrete type.

The generation logic inserts the namespace(s) as attributes of the root
element.  I insert the "default" namespace (i.e.
xmlns:xsi="";) and the
schema-specific namespace (e.g. xmlns:myPrefix="my-schema-site") ["myPrefix"
and "my-schema-site" are not the actual values used, of course].

As I mentioned, if I validate this using the XMLBeans command line
validator, there is no complaint, but when I used the API validator, I get
the error shown.

Regarding your comment on the schema version that is used, what can I do
about that?  I insert the "standard" XML heading into the file before
validating and saving.  E.g. <?xml version="1.0" encoding="utf-8"?>  Does
the version number here indicate the schema version number?

View this message in context:
Sent from the XMLBeans User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to