views:

18

answers:

0

So we have a given XSD such as this:

  <xsd:element name="SomeRequest">
        <xsd:complexType>
              <xsd:sequence>

                    <xsd:element name="RegistrationDetail" type="RegistrationDetailType"
                          minOccurs="0" />
              </xsd:sequence>
        </xsd:complexType>
  </xsd:element>

  <xsd:complexType name="RegistrationDetailType">
        <xsd:sequence>
              <xsd:element name="Registration" type="RegistrationType"
                    maxOccurs="unbounded" />
        </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="RegistrationType">
        <xsd:sequence>
              <xsd:element name="AnotherElem" type="AnotherType" />
              <xsd:element name="YetAnotherElem" type="YetAnotherType" />
        </xsd:sequence>
  </xsd:complexType>

We need this XSD to only have 1 global element, “SomeRequest”… And every element nested in it must be a referenced type as is in the above example. We are currently (and manually) taking the given XSD and creating global elements so that we get a JiBX marshaller for say “Registration” element. This is what we do manually:

  <xsd:element name="SomeRequest">
        <xsd:complexType>
              <xsd:sequence>
                    <xsd:element name="RegistrationDetail" type="RegistrationDetailType"
                          minOccurs="0" />
              </xsd:sequence>
        </xsd:complexType>
  </xsd:element>


  <xsd:complexType name="RegistrationDetailType">
        <xsd:sequence>
              <xsd:element ref="Registration" maxOccurs="unbounded" />
        </xsd:sequence>
  </xsd:complexType>

We need this XSD to only have 1 global Again we wish to keep the previous (the first example) XSD intact and not remake these Types into global elements in order to get a JiBX marshaller/unmarshaller…. Is there anything with Jibx customizations or anything else that we can to obtain a marshaller for a non global (aka: top-level) element?