It turns out I wasn't completely accurate.

When the schema of the add-on project sits in its own namespace and imports the schema of the main project, then xmlbeans does not download the main schema and compiles only the elements in the add-on schema.

Alternatively, when the schema of the add-on project sits in the same namespace as the main project and includes the schema from the main project, then xmlbeans does download, process and compile the elements from the main project.

Hence, xmlbeans appears to follow includes, but not imports.

Because I want the add-on project to use its own namespace, I use <import>, causing xmlbeans to skip stub generation for the imported elements.

Unfortunately, when I later try to parse an xml file that uses elements from both namespaces (having the generated classes of both projects in the classpath), xmlbeans complains the xml is not valid:

[error: cvc-complex-type.2.4a: Expected element "[EMAIL PROTECTED]://xmlmath.org/1.0" instead of "[EMAIL PROTECTED]://xmlmath.org/1.0/date" here in element [EMAIL PROTECTED]://xmlmath.org/1.0]

The above shouldn't fail as the "equals" element is declared to contain child elements of type "value" and element "now" extends from "value" (if it's helpful I can attach the schemas).

I'm not sure why xmlbeans rejects the xml, but I suppose it has to do with the fact that the stubs from one namespace were generated independently from the stubs in the other namespace.

regards,
Erik van Zijst


Erik van Zijst wrote:
Folks,

I'm having a bit of trouble generating only a limited set of stub classes for a set of schemas.

I'm creating a new add-on for an existing xmlbeans-based project. This add-on comes with its own xml schema in its own namespace that extends data types from the main project. To this end, the add-on xsd imports the main schema.

Now the thing is that I want the add-on project to generate xmlbeans stubs for the new elements only. However, because the add-on schema imports the main schema, xmlbeans decides to compile stubs for the main schema as well.

Is it possible to tell xmlbeans to only compile stubs for the elements in a specific schema and to ignore elements declared in imported and included schemas?

Ultimately I want to add the generated stubs of the new project to the classpath as an "add-on" or "plug-in" to the main project, so the stubs of both projects need to be compatible.

regards,
Erik van Zijst

---------------------------------------------------------------------
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]

Reply via email to