Dear list,

we use XmlBeans inst2xsd to create a schema from this simple piece of XML

ns1:Level1 xmlns:ns1="http://schemas.ns1/"; xmlns:ns2="http://schemas.ns2/";>

The output is the following 3 schemas (NS0, NS1 and NS2)

<schema attributeFormDefault="unqualified"
   <element name="Level3" type="xs:string"

<schema attributeFormDefault="unqualified"
elementFormDefault="qualified" targetNamespace="http://schemas.ns2/";
   <element name="Level2" type="sch:Level2Type"
   <complexType name="Level2Type">
       <element ref="Level3"/>

<schema attributeFormDefault="unqualified"
elementFormDefault="qualified" targetNamespace="http://schemas.ns1/";
   <element name="Level1" type="sch:Level1Type"
   <complexType name="Level1Type">
       <element ref="sch:Level2" xmlns:sch="http://schemas.ns2/"/>

Now, NS0, which defines the inner type/element validates fine, but
neither NS1 nor NS2 do, simply because there is no reference (read:
schema import) to the "lower level" schemas.

For example, when using Eclipse's validation function we get the
following for NS2 (which is essentially the message from WS-I

src-resolve.4.2: Error resolving component 'sch:Level2'. It was
detected that 'sch:Level2' is in namespace 'http://schemas.ns2/', but
  from this namespace are not referenceable from schema document
  NS2.xsd'. If this is the incorrect namespace, perhaps the prefix of
'sch:Level2' needs to be changed. If this is the correct namespace,
then an
  appropriate 'import' tag should be added to

This is one half of the story, the other half is:

We generate a WSDL and import these schemas, but WS-I validation fails
with a BP2122 assertion,
and while most consumers work just fine with that WSDL tools like MS
InfoPath simply refuse to
accept it, so we need a way of getting "valid" schemas generated,
which would mean having the
respective imports added as required.

It doesn't look like there are any options to influence inst2xsd
generation in that area,
have I missed something ?

Any suggestions for getting around this ?

Thanks in advance & best regards


Reply via email to